TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

HTML input tag

HTML input tag with examples, forms, input, text, anchor, image, heading, marquee, textarea, paragraph, title, quotes, code etc.

<< Back to HTML

HTML Input Tag

The HTML <input> tag is used to represent a form input control in HTML document. This form input control facilitate user to input data and communicate with a website or application. Let's take an example of an HTML form with three input fields, two text fields and one button for submission.


HTML Input Tag Example

Let's see the example of HTML input tag.

<form action="#">
First name: <input type="text" name="FirstName"  placeholder="enter firstname..."><br>
Last name: <input type="text" name="LastName" placeholder="enter lastname..."><br>
<input type="submit" value="Submit">
</form>
Test it Now

Output:

First name:
Last name:

Click the "Submit" button for sending the form-data to a page on the server.


Points to remember

1) Use the input element within the form element to declare input control that allow user to enter data.

2) The input element is empty. It contains attributes only. There is no need of an end tag in HTML.

3) If you want to define labels for input element, use the label element with each input tag.


Difference between HTML4.01 and HTML5

HTML5 does not support "align" attribute. There are several new attributes for <input> tag in HTML5, and the type attribute has several new values.


Difference between HTML and XHTML

In HTML, <input> tag is used without an end tag. In XHTML, the <input> tag must be properly closed.


Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<input>YesYesYesYesYes
Next TopicHTML ins Tag




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf