Re: "getAttribute" returns a child element instead of ...?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: "getAttribute" returns a child element instead of ...?

From: BootNic <Bootnic@bounce.prodigy.net>
Date: Wed Jan 25 2006 - 16:18:28 CET

> "Noa" <nlevin@jacada.com> wrote:
> news:1138177344.258777.192240@f14g2000cwb.googlegroups.com....
>
> Hi
>
> I have a page that looks like that:
>
> <form name="kuku1" action ="anotherpage.html" >
> <input name="name">
> <input name="kuku2">
> </form>
>
> As far as i know, "getAttribute" should return a string value of an
> elements' attribute.
>
> document.forms[0].getAttribute("action") indeed returns the string
> "anotherpage.html"
> document.forms[0].action will also return that string
>
> However, document.forms[0].getAttribute("name") does not return the
> string "kuku1", but it returns the first input object.
> In a similar way , document.forms[0].getAttribute("kuku2") returns
> the second input element, and not a null object (or an empty
> string) as i would expect.
>
> Is it a bug? is it a defined behavoiur?
> And how can i get the name of the form ???

What would happen if it change <input name="name"> to <input name="_name">?

-- 
BootNic   Wednesday, January 25, 2006 10:18 AM
Every time I close the door on reality it comes in through the windows.
*Jennifer Unlimited*
Received on Tue Feb 7 21:22:40 2006