Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   document.getElementById('id') find out what type of element in javascript (http://www.velocityreviews.com/forums/t925914-document-getelementbyid-id-find-out-what-type-of-element-in-javascript.html)

Katie 07-20-2006 07:54 PM

document.getElementById('id') find out what type of element in javascript
 
Hi

I have a function which uses the document.getElementById('id') to
change attributes of form objects etc. Is there any way i can find out
if the element is a checkbox, textbox, radio button etc, because i want
to distinguish between them in my function

Thanks for ure time and help
:)


Matt Kruse 07-20-2006 08:17 PM

Re: document.getElementById('id') find out what type of element in javascript
 
Katie wrote:
> I have a function which uses the document.getElementById('id') to
> change attributes of form objects etc. Is there any way i can find out
> if the element is a checkbox, textbox, radio button etc, because i
> want to distinguish between them in my function


Check the "type" property, and javascript docs for what values to expect.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com



Randy Webb 07-20-2006 08:25 PM

Re: document.getElementById('id') find out what type of element injavascript
 
Katie said the following on 7/20/2006 3:54 PM:
> Hi
>
> I have a function which uses the document.getElementById('id') to
> change attributes of form objects etc. Is there any way i can find out
> if the element is a checkbox, textbox, radio button etc, because i want
> to distinguish between them in my function


document.getElementById('someDumbIDInsteadOfTheFor msCollection').type

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


All times are GMT. The time now is 09:03 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.