tags:

views:

24

answers:

1

I am using the following code:

$(".searchBtn").closest('form').submit(function () {
   $(this).find('.showComments tr:last').after("<tr><td>TEST</td></tr>");
});

and I have a

<form>
<div>
<table class="showComments"><tr><td></td></tr></table>
</div>
<input type="submit" class="searchBtn" value="Submit">
</form>

in my HTML page.

However, this code doesn't work. Any ideas?

Thanks

Joel

+3  A: 

Works fine for me. Maybe you just need to throw in a return false?

http://jsfiddle.net/h7WCv/

karim79
Yup, that was it!! thnx :)
Joel