JS/JQuery/html 项目随记(一)

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());  
	    });






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值