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 are the primitive data types in JavaScript?
Difference json arrary vs json object ?
How to create a confirmation box?
What is the role of a strict mode in javascript?
What is createtextnode?
What e means?
What is the default scope in javascript?
What is a scope in javascript?
Explain how can you submit a form using JavaScript?
What is the use of Void(0)?
Is javascript harmful?
Is javascript multi-threaded or single-threaded?
How can you read properties of an Object in JavaScript?
What are screen objects?
Who introduced javascript?