How change the property TARGET of tag A (LINK) using CSS?
Please somebody send me an example!
Now I appreciate!Thank you very much!
Please somebody send me an example!
Now I appreciate!Thank you very much!
| Code: |
| <a id="Anchor1" class="link" href="www.frihost.org"> Go to Frihost!</a> |
| Code: |
| <script type="text/javascript">
var AnchorHandle = document.GetElementById('Anchor1'); AnchorHandle.onclick = AnchorHandle.href="www.frihost.com"; </script> |
| Code: |
| <script type="text/javascript">
document.GetElementById('Anchor1').onclick = document.GetElementById('Anchor1').href="www.frihost.com"; </script> |
| Gushe wrote: | ||||||
| Well, to make it more easy you should add an 'ID' property to your anchor element.
Let's say this is the anchor:
Than you should add the following piece of JavaScript to your header.
Or shorter:
Please note I'm still a noobie in JavaScript, so this might not be the best way do do this. Cheerios, ~ GuShe |
| Code: |
|
<html> <head> <script type="text/javascript"> function chg() { var anchor = document.getElementById("Anchor1"); anchor.target = "my_win"; } </script> </head> <body onload="chg()"> <a id="Anchor1" href="http://www.mysite.com">My site</a> </body> </html> |