I am learning how to use JavaScript and I am having trouble correctly displaying the url within the document.write() function. I am writing the program with an actual url in the "href" portion but I can not write it in this question since it is apparently prohibited to do so. Is there something that I am missing?
<!doctype HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Link Test </title>
</head>
<body>
<a id="mylink" href="#"> Click me</a>
<br>
<script type="text/JavaScript">
url = document.links.mylink.href document.write('The URL is ' + url)
</script>
</body>
</html>