Code
< Script Language = "JavaScript" Type = "Text/JavaScript" >
<! --
Window.doc ument. attachevent ( " Onkeydown " , Function (){
If (Window. event. keycode = 13 ){
Window. event. keycode = 9 ;
}
});
// -->
</ Script >
Attachevent description:
The attachevent method can dynamically add an event to an element in a webpage. When you want to add a click event to a button, you will write onclick = event name in the button. You do not need to use attachevent. prepare the written events and bind them to the elements as needed. in addition, attachevent supports binding multiple events to an element. the execution order is, followed by the binding first.
| Syntax: |
element. attachevent (etype, eventname) |
| return value: |
Boolean |
| parameters: |
element: dynamically add an event to the element. etype: specifies the event type. for example: onclick, onkeyup, onmousemove and so on .. eventname: specifies the event name. that is, the function you wrote. |