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


Groups > comp.lang.javascript > #15896

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

From Martin Leese <please@see.Web.for.e-mail.INVALID>
Newsgroups comp.lang.javascript
Subject Re: Accessing properties of <input type="text" id="DetailsView1_txtRowNumber"... />
Date 2012-09-15 10:55 -0600
Organization A noiseless patient Spider
Message-ID <k32btu$smv$1@dont-email.me> (permalink)
References <3c28749c-3ca1-4983-bb5e-3176eae2b007@googlegroups.com> <g88ei9-8q9.ln1@luuk.invalid.lan>

Show all headers | View raw


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>

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

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