About document.getElementID? Explain giving one example.
This was asked by a interviewer when i said that i know
some JavaScript.
Answer Posted / kishore.gsgs
using this u can access any html elements by its id.Here we
are going to access <input> textbox by its id("abc").when we
click on
submit button javascript execute and <tr> will not be displayed
<html>
<head>
<script type="text/javascript">
function change()
{
alert("success");
alert(document.getElementById("kishore").value);
}
</script>
</head>
<body>
<input type="text" id="kishore">
<input type="button" name="submit" value="submit"
onClick="change()"/>
</body>
</html>
| Is This Answer Correct ? | 7 Yes | 3 No |
Post New Answer View All Answers
What is the difference between java & javascript?
Can I open javascript on iphone?
How to empty an array in JavaScript?
Whether JavaScript has concept level scope?
What does => mean in node js?
what will happen and why if i will acess the methods of superclass which is declared as private by a object of same subclass.
How to write a function in javascript?
What is the data type of variables in javascript?
how to validate the date(dd/mm/yyyy)using regular expression in javascript? It should also satisfy the leap year feb 29 problem. Please help me.
How much do javascript programmers make?
Create a new javascript object with the keys of “fname” equal to your first name, “lname” equal to your last name, and “fcolors” equal to and array of 3 of your favorite colors. Assign this object to a variable called “me” and log it to the console.
How to validate a form in javascript?
Is javascript the future?
Is a function an object?
What is emotional closure?