在input输入框中回车激活点击按钮事件代码
<div class="dlchuangkou"> <p class="metingNumber"> 会议码:<input id="txtMetingNumberID" runat="server" type="text" value="在此输入会议码" onkeypress="if(event.keyCode==13) {btnValidate.click();return false;}" onfocus="if(this.value=='在此输入会议码'){this.value='';}" onblur="if(this.value==''){this.value='在此输入会议码'}" class="dltxt01" /> </p> <p class="Numberbutton"> <input type="button" id="btnValidate" value="进入会议" class="dlButton" /> </p> </div>
在input文本框中回车,触发点击按钮事件,主要代码:
onkeypress="if(event.keyCode==13) {btnValidate.click();return false;}"