开发者

Get value of element created at "future"

How to check element value if it will be create at the "future" on page. I know about live metho开发者_如何学Pythond but it works with an event.


Since live requires an event, you could have a look at the livequery plugin for jQuery.

Let's say you want to alert the value of a every dynamically created <input type="text"> with a class of foo, you'd do something like this:

$('input[type=text].foo').livequery(function(){
  alert($(this).val());
});

Here's a working example: http://jsfiddle.net/W7xqk/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜