- <div class="konf_img_container_wrapper">
- <div class="konf_img_container">
- <div class="konf_img_thumb_xs">
- <div>
- <img src="useruploads_thumb/thumb_temp_54_505f0f8866d55.jpg" rel="10">
- <span id="remove-image" class="remove-image">
- <span class="ui-icon ui-icon-trash"></span> </span>
- </div>
- </div>
- <div class="konf_img_thumb_xs">
- <div>
- <img src="useruploads_thumb/thumb_temp_54_505f0f9bf23b8.jpg" rel="11">
- <span id="remove-image" class="remove-image">
- <span class="ui-icon ui-icon-trash"></span> </span>
- </div>
- </div>
- </div>
- </div>
JS:
- function enableHandlers() {
alert("123"); //if this is remove the alert2 doesn't work
$('.konf_img_thumb_xs').on('click','img', function () {
var $img = $(this).parent().find('img').attr('rel');
alert("img"+$img); //alert2
});
$(document).ready(function () {
enableHandlers();
});
if i remove the first alert (alert("123");) the click-alert doesnt work
Why, an how can i change this?