Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

How to change HTML Attribute using HTML DOM? 
 I have given you example to change HTML Attribute by using HTML DOM.
Example:
<html>
<body>
<img id="image" src="oldimage.gif">
<script type="text/javascript">
document.getElementById("image").src="newimage.jpg";
</script>
</body>
</html>
 In the above example we load an image on HTML document by using id="image".Using DOM we get the element with id="image".JavaScript that we used in example to changes the src attribute from oldimage.gif to newimage.jpg


Posted By: Name:Rajesh Kr URL: How to change HTML Attribute using HTML DOM?