DOM: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
m (New page: all elements in a html page can have an id and be altered . Here's how to grab the element by the id and change it using javascript <pre> <a id="link" href="http://www.yahoo.com">tes...)
 
mNo edit summary
Line 1: Line 1:


all elements in a html page can have an id and be altered .  
all elements in a html page can have an id and be altered .  


Here's how to grab the element by the id and change it using javascript
Here's how to grab the element by the id and change it using javascript:





Revision as of 13:53, 29 September 2007


all elements in a html page can have an id and be altered .

Here's how to grab the element by the id and change it using javascript:



<a id="link" href="http://www.yahoo.com">testing</a>

<script type="text/javascript">
 link=document.getElementById('link');
  link.href="http://msdn.com";
</script>