Created
September 23, 2010 13:58
-
-
Save electronicbites/593643 to your computer and use it in GitHub Desktop.
change href dynamic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>test_change_link</title> | |
<script type="text/javascript" language="javascript"> | |
// <![CDATA[ | |
function changeLink() { | |
var linkelem = document.getElementById('mylink'); | |
//alert(linkelem.href); | |
linkelem.href += "&wilma=washere"; | |
alert(linkelem.href); | |
} | |
// ]]> | |
</script> | |
</head> | |
<body onload="javascript:changeLink();"> | |
<a href="http://www.google.com/search?client=safari&rls=en&q=javascript&ie=UTF-8&oe=UTF-8" id="mylink" target="_new"> | |
</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment