Explain with an example the use of event handlers in JavaScript?
Submitted by: AdministratorThe events in JavaScript are the actions in a document that result from user activity. The actions are like clicking on a button or typing a character in the form. JavaScript object in a document that receives events of different kinds. To handle the events that are taking place requires an even handler that can handle the execution of the events. Event acts like an added attribute that is entered in object's HTML. The attribute is consisting of event name, sign like (=), instructions. The following code shows the event handler as :
<HTML>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Hello" onClick="window.alert ('HELLO WORLD')">
</FORM>
</BODY>
</HTML>
Submitted by:
<HTML>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Hello" onClick="window.alert ('HELLO WORLD')">
</FORM>
</BODY>
</HTML>
Submitted by:
Read Online Expert Developer JavaScript Job Interview Questions And Answers
Top Expert Developer JavaScript Questions
☺ | Mention what is the disadvantage of using innerHTML in JavaScript? |
☺ | Which keyword is used to print the text in the screen? |
☺ | Why it is not advised to use innerHTML in JavaScript? |
☺ | Explain the concept of unobtrusive JavaScript? |
☺ | How are JavaScript and ECMA Script related? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | jQuery Mobile Interview Questions. |