我不能選擇元素,改變內容在它 這裏是我的html爲什麼我不能選擇在jQuery的元素和改變內容
<div class="like_user_wrapper" id="<?php echo $post_id.'like_user_wrapper' ;?> ">
hello, world
</div>
<span class="post_bottom_bar">
<img class="thumb_icon" onmouseover="
var post_id=<?php echo $post_id ?>;
$.ajax({
url:'ajax_like_user.php',
method:'post',
data:{post_id:post_id},
success:function(data){
$('<?php echo '#'.$post_id.'like_user_wrapper' ?>').html('hello');
}
})
" >
我不能把它變成打招呼,當我的將鼠標放在圖標上
*不要*使用內聯事件!在JavaScript中正確綁定事件*。 '$('。thumb_icon')。mouseover(function(){})' –