W
Wade
Im purchased Simply Javascript from Sitepoint and Im working on some
of these tutorials and none of them are working. I do not understand
what is wrong.
The html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Get Tag By ID</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<link rel="stylesheet" type="text/css" href="pg84.css" />
<script type="text/javascript" src="pg84.js" />
</head>
<body>
<a id="koko" href="http://www.koko.com/">Lets all get KOKO!</a>
</body>
</html>
And here is the script:
var koko = document.getElementById("koko");
koko.setAttribute("href", "/GetKoko/");
koko.setAttribute("title", "Koko sets the title");
And the error is:
koko has no properties
[Break on this error] koko.setAttribute("href", "/GetKoko/");
Wade
of these tutorials and none of them are working. I do not understand
what is wrong.
The html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Get Tag By ID</title>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<link rel="stylesheet" type="text/css" href="pg84.css" />
<script type="text/javascript" src="pg84.js" />
</head>
<body>
<a id="koko" href="http://www.koko.com/">Lets all get KOKO!</a>
</body>
</html>
And here is the script:
var koko = document.getElementById("koko");
koko.setAttribute("href", "/GetKoko/");
koko.setAttribute("title", "Koko sets the title");
And the error is:
koko has no properties
[Break on this error] koko.setAttribute("href", "/GetKoko/");
Wade