开发者

Get id of .class from php do-while loop

开发者 https://www.devze.com 2023-03-22 21:15 出处:网络
do{ <div class=\"fine\" id=\"<?php echo $i; ?>\"><?php echo $tb_dt_01 ?></div>
do{
<div class="fine" id="<?php echo $i; ?>"><?php echo $tb_dt_01 ?></div>
}while..........

$($('.fine').attr('id')).mouseover(function() {
alert($('.fine').attr('id'));
});

I have the above do-while php loop, the results are displayed with $i incremental. I want to get the id from .fine. But currently it gives me the first value or no value. The alert is just given as a test, to check if the values are given co开发者_如何转开发rrectly


try

$(".fine").mouseover(function() {
  alert($(this).attr("id"));
});
0

精彩评论

暂无评论...
验证码 换一张
取 消