mardi 10 mars 2015

click event not firing on elements inside thickbox


In my plugin I am using thick box modal window to show the list of items. The content in the thickbox div is generated through a ajax request. I have input checkboxes inside this div. The click event on these check boxes are not triggered.


Here is my code:



<div id="wpb_media_tracks_container"> //This div is loaded into the thickbox and contents of this table are dynamically generated through ajax request
<table class="wp_media_tracks_table">
<thead>
<tr>
<th>Choose tracks</th>
<th>Filename</th>
<th>Title</th>
</tr>
</thead>
<tbody>
<tr valign="top">
<td scope="row">
<input type="checkbox" name="1522" value="1522">
</td>
<td>raagrang.mp3</td>
<td>raagrang</td>
</tr>
</tbody>
</table>
</div>


jQuery code:



jQuery('.wp_media_tracks_table input').on("click", function() {

postId = jQuery(this).val();
alert(postId);
});


I also tried using this selectotr: jQuery('#wpb_media_tracks_container input'). But no results.


Can any one help me find the issue in my code?


Thanks,





Aucun commentaire:

Enregistrer un commentaire