I have an example explained here to show how "getElementById" is used in JavaScript. Write me (saalram.service@gmail.com) if you find difficult here.
File :  GetElement_JS.html
 
<html>
<head>
<script type="text/javascript">
function alertId()
{
var txt="Id: " + document.getElementById("myButton").id;
txt=txt + ", type: " + document.getElementById("myButton").type;
 txt=txt + ", value: " + document.getElementById("myButton").value;
alert(txt);
document.getElementById("myButton").disabled=true;
}
</script>
</head>
<body>
 <form>
<input type="button" value="Click me!" id="myButton" onclick="alertId()" />
</form>
</body>
</html> 
====================
 Publicize yourself ... Free!
saalram
====================
 
Jan 17, 2010
Subscribe to:
Post Comments (Atom)
 
 

 
 
No comments:
Post a Comment
Saalram.com