W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2008

[whatwg] Placeholder option for text input boxes

From: timeless <timeless@gmail.com>
Date: Thu, 2 Oct 2008 17:22:19 +0300
Message-ID: <26b395e60810020722l711f131fwa25e3f9b0488cdc6@mail.gmail.com>
Is vbscript defined to have the same dom bindings as jscript?

On 10/2/08, Kristof Zelechovski <giecrilj at stegny.2a.pl> wrote:
> INPUT. CHECKED = "checked"
> is equivalent to
> INPUT. SETATTRIBUTE "checked", "checked"
> as of MSIE7.
>
> Chris
>
> My unit test:
>
> SET L5ELEMS = ME. ELEMENTS
> SET A1C = L5ELEMS. NAMEDITEM("ITSTEST")
> IF A1C. TAGNAME <> "INPUT" THEN STOP
> IF A1C. GETATTRIBUTE("type") <> "checkbox" THEN STOP
> IF A1C. GETATTRIBUTE("checked") THEN STOP
> REM A1C. SETATTRIBUTE "checked", "checked"
> A1C. CHECKED = "checked"
> IF NOT A1C. GETATTRIBUTE("checked") THEN STOP
>
>
> -----Original Message-----
> From: whatwg-bounces at lists.whatwg.org
> [mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Garrett Smith
> Sent: Thursday, October 02, 2008 2:46 AM
> To: whatwg
> Subject: Re: [whatwg] Placeholder option for text input boxes
>
> IE:
> (did not test) -  FWIRC, getAttribute('checked') will return the value
> |false|, what happens after that, I do not know.
>
> <!DOCTYPE html>
> <html lang="en">
> <head>
> 	<title>CHeckbox-attribute.html</title>
> </head>
> <body>
> <form action="">
>   <input type="checkbox" checked="checked" id="c">
>   <input id="b" value='asdf'>
> </form>
> <pre>
> <script type="text/javascript">
> var d = document, c = d.getElementById('c');
> var b = d.getElementById('b');
>
> b.value = 1;
> d.writeln("b.getAttribute('value'):..." + b.getAttribute('value'));
>
> c.checked = false;
> d.writeln("\nc.checked:................." + c.checked);
> d.writeln("c.getAttribute('checked'): "+c.getAttribute('checked'));
> d.writeln("c.setAttribute('checked', 'checked');");
> c.setAttribute('checked', 'checked');
> d.writeln("c.checked:................." + c.checked);
> </script>
> </pre>
> </body>
> </html>
>
>
>

-- 
Sent from Gmail for mobile | mobile.google.com
Received on Thursday, 2 October 2008 07:22:19 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:06 UTC