我想用js输出一个a的超链接,链接的内容想用location对象获取可以么?怎么实现?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>location</title>
</head>
<script type="text/javascript">
document.write(window.location.href);
</script>
</head>
<body>
</body>
</html>