Category: 

What is an Input Tag?

Article Details
  • Written By: Mary Elizabeth
  • Edited By: Bronwyn Harris
  • Last Modified Date: 04 November 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The mongoose was introduced to Hawaii in order to kill rats, but mongooses hunt in the day, while rats are nocturnal.  more...

December 7 ,  1941 :  Japanese bombers attack Pearl Harbor.  more...

A tag is a formatting code that is part of a document language, also known as a markup language, used to annotate a text in a way that is distinct from the text and provides instructions for how the text is to be displayed. There are various markup systems that have a large number of unique tags. The markup systems or languages include TeX, Scribe, GML, SGML, HTML, XML, and XHTML. HTML stands for HyperText Markup Language and it is used in the World Wide Web to create structure for text and documents and to create hyperlinks between documents, while XHTML (extensible HTML) combines HTML and XML. The input tag is an HTML and XHTML tag, and it is supported by Microsoft® Internet Explorer®, Mozilla® Firefox®, Opera®, Google® Chrome®, and Apple® Safari® browsers.

Many HTML and XHTML tags serve to format text that is on the page, but some create opportunities for user interaction, and the input tag is one of the latter: it is a key player in building forms. There is an important difference between how the input tag is used in HTML and how it is used in XHTML, however. In HTML the tag <input> is used, with the ellipses replaced by whatever content the tag holds, and has no end tag. In XHTML, the input tag requires a proper closing like this <input/>.

Ad

The input tag must include the type attribute to specify the type of control field to be used. The possibilities are: button, checkbox, file, hidden, image, password, radio, reset, submit, and text. The button type usually has an action programmed with a client side script, such as JavaScript®, while the checkbox and radio buttons toggle on and off when clicked. The file type allows the user to upload a file, while hidden values are not displayed but stay attached to the form entry. Password differs from text in that it often has dots or asterisks to mask the characters that are entered, and submit, image — which is a kind of submit button — and reset are global treatments of form data.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email