Your Open Source
Free YourOpenSource Softwares Online Resources and Softwares Downloads with Demo
Related Posts
GetElementById or getElementByName Method
getElementById or getElementBy Name :
You can get the element values from the document by using getElementById() or getElementByName() function. Both functions get the element from the document.Syntax:
getElementById("element_id");
getElementByName("element_name");The Example as follows :-
<html>
<head>
<title>getElementByID() Method Example</title>
</head>
<body>
<script>
function changeIt(){
var obj = document.getElementById("txt_content");
obj.innerHTML = "You have clicked!";
}
</script>
<div id="txt_content" onclick="changeIt()"> Click Here</div>
</body>
</html>
5058
Oct 09 09 11:35:11
Sekar
|
Rating :
![]() ![]() ![]() ![]() ![]() | Tags :- JavaScript |
|
|||||||||||
Digg
Yahoo
delicious
