[wd_asp elements=’search’ ratio=’100%’ id=1]

Get value of text box using Jquery Find not Closest

20th June 2019

Jquery Misc

jquery icon

When I click on the button I want to grab the text in the nearest text box using Jquery. Usually closest did the trick, but this time I got the nearest TR and searched within it using ‘find’.

FORM CODE

echo '

SAVE

';

The answer: –

var thetext = $(this).closest("tr").find(".mykeyword").val();
alert(thetext);