dimanche 17 décembre 2017

checking if child input is checked

So... I need to check if input checkbox is checked, and i know in what element it is, but ,for some reason, when i try "find()" or "children()" it's giving me an error (not a function) :/ html:

  <ul id="playlist">    
<li class="current-song hińska_muzyka"><input type="checkbox" checked class="hińska_muzyka_ch"/><a href="somme_src">name</a></li>
</ul>

JS:

alert($("#playlist li")[currentSong].children('input').checked);
alert($("#playlist li")[currentSong].find('input').checked);

In js both not working :/ I can't figure out what i should do to make it work. And as you can probably deduce currentSong is my var that contain index of li with currently playing song.




Aucun commentaire:

Enregistrer un commentaire