如何在单击“showImages”时检索特定的隐藏字段值
<span class="isymbol" id="showImages" href="Javascript:Void(0);"></span>
<input type="hidden" name="hdnplaceid[<?php echo $k; ?>]" id="hdnplaceid" value="<?php echo $PackageDetailsSightSeeing[$k]['deal_place_id']; ?>">
<input type="hidden" name="hdncityid[<?php echo $k; ?>]" id="hdncityid" value="<?php echo $PackageDetailsSightSeeing[$k]['deal_city_id']; ?>">
我试过这个,但每次我得到相同的值,不管我点击的按钮是什么
$('.isymbol').click( function() {
var placeid= $("#hdnplaceid").val();
// $("#hdnplaceid").val();
var cityid=$("#hdncityid").val();
alert(placeid);
alert(cityid);
loadImagePopupBox();
});
跨度和输入字段在 for 循环中。所以它们是动态生成的。
谢谢,