|
INTERVIEW QUESTIONS
WEB
JAVA SCRIPT
DETAILS
Question: How to remove the event listener?
Answer: <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>
|
|
|
Category |
Java Script Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 6904 users |
Added on |
9/22/2014 |
Views |
71744 |
Rate it! |
|
|
Question:
How to remove the event listener?
Answer:
<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> Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
How to Handle Event Handlers?
|
View Answer
|
|
How to getting values from cookies to set widgets?
|
View Answer
|
|
How to setting a cookie with the contents of a textbox?
|
View Answer
|
|
How to open a window with no toolbar, but with the location object?
|
View Answer
|
|
How to create an input box?
|
View Answer
|
|
How to create a confirmation box?
|
View Answer
|
|
How to create a popup warning box?
|
View Answer
|
|
Explain unescape() and escape() in JavaScript?
|
View Answer
|
|
How to have the status line update when the mouse goes over a link (The support of the status line is sporadic)?
|
View Answer
|
|
How to have an element invoke a JavaScript on selection, instead of going to a new URL?
|
View Answer
|
|
How to Add new elements dynamically?
|
View Answer
|
|
To write messages to the screen without using "document.write()"?
|
View Answer
|
|
How to disable an HTML object?
|
View Answer
|
|
How to find radio button selection when a form is submitted?
|
View Answer
|
|
How to find the selected radio button immediately using the 'this' variable?
|
View Answer
|
|
What is === operator?
|
View Answer
|
|
What are undefined and undeclared variables?
|
View Answer
|
|
Does JavaScript have the concept level scope?
|
View Answer
|
|
What is variable typing in JavaScript?
|
View Answer
|
|
What is the difference between undefined value and null value?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All Java Script Interview Questions & Answers - Exam Mode /
Learning Mode
|