使用JQuery动态的为Html5中的input 中的属性逐一添加序号适用id/class 在代码里游泳 2020-06-09 164 阅读1分钟 $(".checkboxs").each(function(index){ $(this).attr('id',"tyue-checkbox-blue"+index); $(this).next().attr('for',"tyue-checkbox-blue"+index) })