there. I was trying to create a link in current html page. But the page seems to change only when I click the "submit" button in chrome. The link won't appear in the page.Could anyone tell me what I did wrong? The code looks like this:
<!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">
<head>
Link Generator
</head>
<body>
<form name="nba" action="test3.html" onsubmit="return createlink();" method="post">
ASIN:<input type="text" name="team" />
<input type="submit" value="Submit!" />
</form>
<span id="insertHere"></span>
<script type="text/javascript">
function createlink(){
var link = document.createElement("a");
link.textContent = "http://www.nba.com/" + document.nba.team.value;
link.href = "http://www.nba.com/" + document.nba.team.value;
document.write(link);
document.write("<h1> </h1>");
document.body.appendChild(link);
}
</script>
</body>
</html>