Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the difference between push() and concat() in javascript?

1048


How to create an object in javascript?

1132


What are the different ways to create an array in javascript?

920


How do you write an event emitter base class that allows you to add event listeners?

950


How to get the contents of an input box using javascript?

1001


What is an anonymous function in JavaScript?

985


What does 3 dots mean in javascript?

844


discuss scoping in javascript?

888


How do you round a value in javascript?

875


What is the difference between sessionstate and viewstate?

879


How to have the status line update when the mouse goes over a link (the support of the status line is sporadic)?

898


wap to accept an int array frm the user and print the lucky nos.

2056


How do I enable cookies and javascript?

862


What Is The Disadvantages Using InnerHTML In JavaScript?

946


Is javascript a security risk?

933