Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to remove the event listener?
How to remove the event listener?
✍: Guest
<script type="text/javascript"><!--
document.getElementById("hitme4").removeEventListener("click", hitme4, false);
// -->
</script>
Key Events
"onkeydown", "onkeypress", "onkeyup" events are supported both in ie and standards-based browsers.
<script type="text/javascript">
function setStatus(name,evt) {
evt = (evt) ? evt : ((event) ? event : null); /* ie or standard? */
var charCode = evt.charCode;
var status = document.getElementById("keyteststatus");
var text = name +": "+evt.keyCode;
status.innerHTML = text;
status.textContent = text;
}
</script>
<form action="">
<input type="text" name="keytest" size="1" value=""
onkeyup="setStatus('keyup',event)"
onkeydown="setStatus('keydown',event)"
/>
<p id="keyteststatus">status</p>
</form>
2011-05-31, 3533👍, 0💬
Popular Posts:
What will be printed as the result of the operation below: main() { int x=5; printf("%d,%d,%d\n",x,x. ..
What print out will the folloging code produce? main() { char *p1=“name”; char *p2; p2=(char*)malloc...
What does AddressOf operator do in background ? The AddressOf operator creates a delegate object to ...
What is the value of this expression? +1-2*3/4 -0.5
What CLASSPATH Settings Are Needed to Run JUnit? It doesn't matter if you run your JUnit tests from ...