1.html按钮响应时间参数传递写法(直接显示在响应事件中会报错因为字符串当中会存在字符没有转义成html)
<input type="button" class="bt_com4" id="downLoad_bt<%=index.intValue()%>" attachmentId="<bean:write name='providerTaxInfo' property='attachmentId'/>"
style="<logic:empty name="providerTaxInfo" property="attachmentId">display: none;</logic:empty>" οnclick="downLoad(this.attachmentId,'<%=index.intValue()%>')" value="下载附件"/>
2.Html自定义属性,点击事件获取对应的属性值
<input type="text" name="evaluateScore_${provider.providerId}" value="${score.evlauateScore }" style="width: 90%" class="evaluateScore"
indexId="${index.indexId}" indexLevel="${index.indexLevel}" indexWeight="${index.indexWeight}" οnblur="checkScore(this)"/>
function checkScore(obj){
alert(obj.getAttribute("indexId"));
}
3.js控制台打印
console.log($(this).val());
4.JS select 选择框选择对应的值
$(".selectIsEvaluate").find("option[value='1']").attr("selected",true);
5.jQuery根据class名称遍历取对应的值
$(".isEvaluate").each(function(){
console.log($(this).val());
});