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/
精彩评论