List Info

Thread: Re: var contains to data; but why?




Re: var contains to data; but why?
country flaguser name
United States
2008-03-10 11:15:51


> var contains to data; but why?
>; Posted by: "wadesmart" no_reply%40yahoogroups.com">no_replyyahoogroups.com wadesmart
> Date: Mon Mar 10, 2008 12:19 am ((PDT))
>
> Im purchased Simply Javascript from Sitepoint and Im working on some
>; of these tutorials and none of them are working. I cant what is wrong
> though Im coping right out of the book.
>
> The html page:
&gt; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
&gt; "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;>
> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=";en-US";>
&gt; <head&gt;
> <title&gt;Get Tag By ID</title>
&gt; <meta http-equiv="Content-Type&quot; content=&quot;text/html;
> charset=utf-8" />
&gt; <link rel="stylesheet&quot; type=";text/css&quot; href=";pg84.css&quot; />
&gt; <script type=";text/javascript"; src="pg84.js&quot; />
&gt; </head&gt;
>
> <body&gt;
> <a id="koko" href=";http://www.koko.com/">Lets all get KOKO!</a>
>; </body&gt;
> </html&gt;
>
>
> And here is the script:
> var koko = document.getElementById("koko");
> smart.setAttribute(&quot;href&quot;, "/GetKoko/");
> smart.setAttribute(&quot;title&quot;, "Koko sets the title";);

I don't see where you've defined any object named smart. Perhaps you
intended koko.setAttribute(...) ...?

>
>
> And the error is:
> koko has no properties
> [Break on this error] smart.setAttribute(&quot;href&quot;, "/GetKoko/");
>
> Wade

--
This message has not been scanned for viruses.

Since I do not use a Microsoft operating
system or software, and use only plaintext
for email, there is little need for me to do so.

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )