JQuery Clear Appended Textbox?

This might work: $('table#listings > tbody:last > tr:last input'). Val('').

You should not serialise HTML to a string when you can avoid it. You want to clone the element. Also cache the selector to the table.

This means you only need to select it once. Function newRow(){ var table = $('table#listings'), newRow = table. Find('tr:first').clone(); newRow.

Find(':input'). Val(''); table. Find('> tbody:last').

Append(newRow); }.

Cleaner than mine. You'ld need to drop the 'row' class selector though. – John Green - PageSpike May 22 at 8:29 @John Thanks, didn't notice that.

Will fix :) – alex May 22 at 8:31.

You had some problems in your selectors... and then what you were doing with your selectors. : ) function newRow(){ var sourceRow = $('table#listings tr').html(); var destRow = $(''+sourceRow+''); destRow. Find('input').

Val(''); $('table#listings > tbody:last'). Append(destRow); return false; } I've made it a bit more atomic so that it is easier to read. Fiddle Added: note that there is nothing with a class of 'row' in your example.

The items are dynamically appended using the Ajax.ActionLink() and a partial view "_NewRow. Cshtml" to define the markup. Here's my Index.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions