-1
我有我的<ima>
其中包含data
,data-commentId
,我尝试用一个函数来获取数据,但它不工作如何使用的onclick将数据发送到一个功能=“功能myfunction的()”
JS
function getsome(){
var comment_id=$(this).attr('data-commentId');
alert(comment_id);
}
HTML
echo '<img onclick="getsome()" class="c_like_icon" data-commentId="'.$reply_id.'" src="img/thumb_icon.png" height="18" width="18">';
'$(this).data('commentId');' – hjpotter92