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"
" <html xmlns=" 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=" 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
line1: koko.setAttribute("href","/GetKoko/");
I have also tried:
koko.href = '/GetKoko/'
koko.title = 'Koko sets the title';
Im using Firefox 2.0.0.12 using Firebug 1.05 extension.
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"
" <html xmlns=" 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=" 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
line1: koko.setAttribute("href","/GetKoko/");
I have also tried:
koko.href = '/GetKoko/'
koko.title = 'Koko sets the title';
Im using Firefox 2.0.0.12 using Firebug 1.05 extension.
Wade