About document.getElementID? Explain giving one example.
This was asked by a interviewer when i said that i know
some JavaScript.
Answer Posted / negi
using this u can access any html elements by its id.Here we
are going to access <tr> by its id("abc").when we click on
submit button javascript execute and <tr> will not be displayed.
<html>
<head>
<title>xxx</title>
<script language="javascript" type="text/javascript">
function change()
{
document.getElementById("abc").style='none';
return true;
}
</script>
</head>
<body>
<table>
<tr id="abc">
<td>you are great</td>
<td><input type="submit" name="submit" value=""
onClick="return change();"/></td>
</tr>
</table>
</body>
</html>
Is This Answer Correct ? | 17 Yes | 6 No |
Post New Answer View All Answers
java pgme for class members hours:minutes:seconds then the constructor expects milliseconds as assignment and initialize data members the members function print hh:mm:ss 90,000 milliseconds passed in constructor then the output is 00:01:30
Does html5 replace javascript?
Explain unescape() in javascript?
what is function of stdio.h
What is difference between java and javascript?
What is the use of javascript?
what is a dataset
Can I open javascript on iphone?
How to write normal text code using JavaScript dynamically?
What is the difference between the substr() and substring() functions in javascript?
What is enum size?
How generic objects can be created?
What is the difference between HTMLCollection and NodeList?
What are the uses of javascript in web page designing?
Should I learn java first or javascript?