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 / 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


Please Help Members By Posting Answers For Below Questions

How to write html code dynamically using JavaScript?

1033


why can't we call a static method from a non-static method

2286


How to create arrays in javascript?

1025


How to write a function in javascript?

966


Why is it called javascript?

1000


Why do we use javascript?

967


How do I turn on javascript?

920


What is the javascript function?

1084


What is double exclamation point?

998


How to convert a string to a number using javascript?

1119


Difference between '=', '==' and '===' operators?

1034


Event bubbling and Event Capturing in JavScript?

1045


What javascript method would convert the string “20” to an integer (on the fly) so “20” + 20 = 40?

981


What kind of conditional statements does JavaScript support?

1005


How typeof operator works?

1087