开发者

Get value of element created at "future"

开发者 https://www.devze.com 2023-03-10 08:12 出处:网络
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

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

精彩评论

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