I have my <ima>
which contains the data
, data-commentId
, and I try to use a function to get the data, but it's not working
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">';