How to change a link text in Javascript
Let's say you have a link, with the anchor text 'mylink', and you want to change this text using Javascript. For this we will use innerHTML attribute. Here it is:
document.getElementByID( 'mylinkid' ).innerHTML = 'my new link text';
You will probably need this if youn need to show/hide some html elements.
No comments:
Post a Comment