开发者

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());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜