如何在jquery中添加onkeyup / onfocus / onchange [英] How can I add onkeyup/onfocus/onchange in jquery
问题描述
如何在代码中添加onkeyup / onfocus / onchange,例如
UpdatePckTypeValue.setAttribute(onclick,CalculateUpdateAmount());
How can I add onkeyup/onfocus/onchange in the codes like
UpdatePckTypeValue.setAttribute("onclick", "CalculateUpdateAmount()");
推荐答案
btnSubmit.Attributes.Add("onclick", "return checkSubmission()")
txtHeadQuantity_1.Attributes.Add("onblur", "return IsNumber(this,this.value)")
txtHeadQuantity_1.Attributes.Add("onfocus", "saveValue(this.value)")
'txtH<pre lang="c#">
eadWeight_1.Attributes.Add(\"onbl ur,返回IsNumberDecimal(this,this.value))
'txtHeadTemp_1.Attributes.Add(onblur,return IsNumberDecimal(this,this.value))
txtROTNumber.Attributes.Add(onchange,checkNumberExit(this,this.value))
txtShippingRef.Attributes.Add(onblur,return CheckShippingRefNumber(this,this .value))
eadWeight_1.Attributes.Add("onblur", "return IsNumberDecimal(this,this.value)")
'txtHeadTemp_1.Attributes.Add("onblur", "return IsNumberDecimal(this,this.value)")
txtROTNumber.Attributes.Add("onchange", "checkNumberExit(this,this.value)")
txtShippingRef.Attributes.Add("onblur", "return CheckShippingRefNumber(this,this.value)")
如果您的服务器端控件那么使用这样的
if your server side control then use like this
(文件).ready(function(){
var controlid ='#'+'& lt;%= Control.ClientID%& gt;';
(document).ready(function(){
var controlid='#'+'<%=Control.ClientID %>';
这篇关于如何在jquery中添加onkeyup / onfocus / onchange的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!