I have the following html code:
<div id='list'>
<ul></ul>
</div>
And I have the following jQuery script:
function append_list(){
$('ul').append('<li><input type="image" name="original" value="'+SOMEVALUE+'"></li>');
}
function find_input(){
}
$(document).ready(function(){
append_list();
console.log($('input'));
find_input();
});
And when I look at the browser console, the output of console.log was just an empty array of “[]”, but if I enter console.log ($ ('input')); in my browser console after loading the page, it can receive feedback with the correct data ... I did a bad job with the .append () function?
Thank you for your help.
---- EDIT ----
Thanks guys, I would like to add something to my question. I tried your suggestion setTimeout (); but still can not find the input element that I added. I also add console.log($('input));in function append_list();too without help ... Now I put it here: - (