please help this is well urgent and doing my head in
i want to change the href of an <a> tag to that of an image so they are both the same.
Expand|Select|Wrap|Line Numbers
- <script language="JavaScript" type="text/javascript">
- function setURL(){
- var image=document.getElementById('mainpic');
- var lnk=document.getElementById("link")
- lnk.href = image.src;
- }
- </script>
- <div id="loadarea">
- <a id="link" href="javascript:setURL()" rel="lightbox" style="border:0px">
- <img id="mainpic" src="http://fashionvault.esellerproimages.com/I/608/MCJ2895-1.jpg" rel="lightbox" style="border:0px">
- </a>
- </div>
i've googled this but can't find anything
please help guys
thanks in advance
:)