Using Javascript to Replace Link -


i'm using javascript code in attempt replace links on page message says "download", hyperlink leads registration page.

the problem "download" text not replacing original link text. original link displayed. lead registration page, again, original link on page still visible text.

any ideas?

<script>     function replacelinks() {         var links = document.getelementsbytagname('a');         (var = 0; < links.length; i++) {             links[i].innerhtml = 'download' +                      '<a href="register.php">register here</a>.';             links[i].href = 'register.php';         }     } </script> 

it should be:

function replacelinks() {     var links = document.getelementsbytagname('a');     (var = 0; < links.length; i++) {         links[i].innerhtml = 'download register here.';         links[i].href = 'register.php';     } } 

the property innerhtml, last part uppercase. , don't need nest link inside link.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -