Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22599

Re: Default values of checkboxes in forms

From Denis McMahon <denismfmcmahon@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: Default values of checkboxes in forms
Date 2014-01-13 13:02 +0000
Organization A noiseless patient Spider
Message-ID <lb0o51$k2a$1@dont-email.me> (permalink)
References (4 earlier) <XnsA2B36270A6918eejj99@194.109.133.133> <0ac12068-c3ea-45e1-99a4-a2e479bf2246@googlegroups.com> <XnsA2B3B56EEFAB0eejj99@194.109.133.133> <2d59b041-54b1-4e0a-9cd9-e27347f6d168@googlegroups.com> <XnsA2B476C6B92D7eejj99@194.109.133.133>

Show all headers | View raw


On Mon, 13 Jan 2014 11:40:34 +0100, Evertjan. wrote:

> btw, what do you think will be returned here?
> First try to imagine it by analizing the code,
> and then test it by applying it to a file:
> 
> ============= test.html ================
> <input type='checkbox' name='hi' id='lo' checked>
> 
> <script type='text/javascript'>
>     alert(document.getElementById('lo').name);
>     alert(document.getElementById('lo').checked);
>     alert(document.getElementsByName('hi')[0].id);
> </script>
> ========================================

I think this is a trick question. alert doesn't return a value.

I think the output of the three alerts will be:

First: The string value: "hi"
Second: The boolean value: true
Third: The string value: "lo"

-- 
Denis McMahon, denismfmcmahon@gmail.com

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-11 23:05 -0800
  Re: Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-11 23:24 -0800
    Re: Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-11 23:43 -0800
      Re: Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-11 23:58 -0800
        Re: Default values of checkboxes in forms "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-12 09:40 +0100
          Re: Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-12 01:58 -0800
            Re: Default values of checkboxes in forms "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-12 17:50 +0100
              Re: Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-12 22:52 -0800
                Re: Default values of checkboxes in forms "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-13 11:40 +0100
                Re: Default values of checkboxes in forms Denis McMahon <denismfmcmahon@gmail.com> - 2014-01-13 13:02 +0000
                Re: Default values of checkboxes in forms "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-13 15:00 +0100
              Re: Default values of checkboxes in forms jonas.thornvall@gmail.com - 2014-01-13 01:28 -0800
                Re: Default values of checkboxes in forms "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-01-13 11:10 +0100
  Re: Default values of checkboxes in forms "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2014-01-12 10:37 +0200
  Re: Default values of checkboxes in forms Tim Streater <timstreater@greenbee.net> - 2014-01-12 09:25 +0000

csiph-web