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


Groups > comp.lang.javascript > #15897

Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... />

Path csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.x-privat.org!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Date Sat, 15 Sep 2012 19:48:06 +0200
From Luuk <luuk@invalid.lan>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version 1.0
Newsgroups comp.lang.javascript
Subject Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... />
References <3c28749c-3ca1-4983-bb5e-3176eae2b007@googlegroups.com> <g88ei9-8q9.ln1@luuk.invalid.lan> <k32btu$smv$1@dont-email.me>
In-Reply-To <k32btu$smv$1@dont-email.me>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <hjrei9-kqe.ln1@luuk.invalid.lan> (permalink)
Lines 30
NNTP-Posting-Host 2001:980:9089:1:d5d4:8fcb:43d3:484a
X-Trace 1347731401 news.xs4all.nl 6978 [2001:980:9089:1:d5d4:8fcb:43d3:484a]:46222
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.javascript:15897

Show key headers only | View raw


On 15-09-2012 18:55, Martin Leese wrote:
> Luuk wrote:
>> <html>
>> <head>
>> <title>title</title>
>> <script>
>> function testthis() {
>>     alert('testthis');
>>     var i=document.getElementsByTagName('input');
>>     alert ('Type:'+i[0].type);
>>     alert ('id:'+i[0].id);
>
> id's are unique within a page, so can just use:
>      var i=document.getElementById('DetailsView1_txtRowNumber');
>      alert ('Type:'+i.type);
>
>> }
>> </script>
>> </head>
>> <body onload="testthis();">
>> <input type="text" id="DetailsView1_txtRowNumber"... />
>> </body>
>> </html>
>

yep,
But most of the times you will have more than one 'input'...
And i cannot think why *every* input should have a unique id....

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


Thread

Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... /> chaimzv@gmail.com - 2012-09-15 03:36 -0700
  Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... /> Luuk <luuk@invalid.lan> - 2012-09-15 14:17 +0200
    Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... /> Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-09-15 10:55 -0600
      Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... /> Luuk <luuk@invalid.lan> - 2012-09-15 19:48 +0200
  Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... /> chaimzv@gmail.com - 2012-09-15 12:26 -0700
    Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... /> chaimzv@gmail.com - 2012-09-15 12:27 -0700

csiph-web