Hi,
I have a simple link:
and I want to change the href value (#) into another with an external js function, how can I do it?PHP Code:<a href="#" id="my">text</a>
Thanks!![]()
Hi,
I have a simple link:
and I want to change the href value (#) into another with an external js function, how can I do it?PHP Code:<a href="#" id="my">text</a>
Thanks!![]()
I'm terrible with JavaScript, but I think the above may work, can't test it for you at the moment though, unfortunately.Code:function changeLink(id,link) { document.getElementById(id).href = link; } changeLink('my','changed.html');
Last edited by Schmoopy; 11-16-2009 at 02:55 PM.
lord22 (11-16-2009)
Bookmarks