I want to fill a text field in a page with a variable taken from the same page
I want to know how I can get the last 开发者_JAVA技巧element of $('span.srs');
and assign it to a variable. Then the variable is inserted into a text field with $("input[name=Any]").val();
. Is that possible or there is another way?
$("input[name=Any]").val($('span.srs:last').text());
var last = $('span.srs:last-child');
$("input[name=Any]").val(last.text());
精彩评论