Internet
Fact-checked

At EasyTechJunkie, we're committed to delivering accurate, trustworthy information. Our expert-authored content is rigorously fact-checked and sourced from credible authorities. Discover how we uphold the highest standards in providing you with reliable knowledge.

Learn more...

What is an Input Tag?

Mary Elizabeth
Mary Elizabeth
Mary Elizabeth
Mary Elizabeth

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/>.

Woman doing a handstand with a computer
Woman doing a handstand with a computer

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.

Mary Elizabeth
Mary Elizabeth

Mary Elizabeth is passionate about reading, writing, and research, and has a penchant for correcting misinformation on the Internet. In addition to contributing articles to EasyTechJunkie about art, literature, and music, Mary Elizabeth is a teacher, composer, and author. She has a B.A. from the University of Chicago’s writing program and an M.A. from the University of Vermont, and she has written books, study guides, and teacher materials on language and literature, as well as music composition content for Sibelius Software.

Learn more...
Mary Elizabeth
Mary Elizabeth

Mary Elizabeth is passionate about reading, writing, and research, and has a penchant for correcting misinformation on the Internet. In addition to contributing articles to EasyTechJunkie about art, literature, and music, Mary Elizabeth is a teacher, composer, and author. She has a B.A. from the University of Chicago’s writing program and an M.A. from the University of Vermont, and she has written books, study guides, and teacher materials on language and literature, as well as music composition content for Sibelius Software.

Learn more...

Discuss this Article

Post your comments
Login:
Forgot password?
Register:
    • Woman doing a handstand with a computer
      Woman doing a handstand with a computer