<script type="text/javascript">
function choose_customer(){
$('[nctype="btn_add_customer"]').each(function(index){
if(!$(this).attr('data-customer_id')){
$('[sort='+index+']').removeClass('ncsc-btn-green');
//alert($(this).parent('li').html());
$('[sort='+index+'] > span').text('<?php echo $lang['choose_already'];?>');
}else{
//alert($(this).parent('li').html());
$('[sort='+index+'] > span').text('<?php echo $lang['choose_customer'];?>');
}
});
}
$(function(){choose_customer();});
</script>
<!--
//$key 是遍历的键值,代码段:<?php foreach($output['store_customer_list'] as $key=>$val){?>
//使用each将相同的<a>遍历出来, .each() 描述: 遍历一个jQuery对象,为每个匹配元素执行一个函数。
//属性 data-customer_id 为空是去掉&
jquery 使用each 遍历标签元素,修改标签内容
最新推荐文章于 2021-10-16 17:50:28 发布