spacer
Yehuda Shiran August 2, 2000
INPUT Elements
Tips: August 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

Both Internet Explorer and Netscape Navigator enable you to retrieve a given element's type. Each and every form element (button, radio, text area, etc.) features a type property which reflects the type of that form element. The type property follows the element reference. For example, you can access the type of the first element of the first form in the following fashion:

document.forms[0].elements[0].type

Here are all the form elements with their corresponding types:

HTML Element

 type Property

INPUT TYPE="button""button"
INPUT TYPE="checkbox""checkbox"
INPUT TYPE="file""file"
INPUT TYPE="hidden""hidden"
INPUT TYPE="password""password"
INPUT TYPE="radio""radio"
INPUT TYPE="reset""reset"
INPUT TYPE="submit""submit"
INPUT TYPE="text""text"
SELECT"select-one"
SELECT MULTIPLE"select-multiple"
TEXTAREA"textarea"


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Workers Say Telework Is More Productive, Bosses Not So Sure · Kingston Debuts Power-Saving Memory Upgrades · Social Networking is King: Facebook Edges Google