Fad*_*zil 4 html javascript jquery
如果我有像这样的html元素
<input type = "text" onkeypress="if(this.keyCode == 13){alert()}" />
Run Code Online (Sandbox Code Playgroud)
不行,请指教
你可以这样试试
<input type = "text" onkeypress="javascript: if(event.keyCode == 13) alert();" />
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>Run Code Online (Sandbox Code Playgroud)