What is HTML Input Tag

In this article I will explain what is input tag and how can we use it.
  • 2527

Introduction

HTML enables us to create forms and forms can be used to make our website more attractive. An HTML form is made up of any number of form elements. These elements enable the user to do things such as enter information or make a selection from a preset options. In HTML, a form is defined using the <form>....</form> tags. The input tag can be used inside the form tag . This is the most commonly used tag within HTML forms. Input tag allows us to specify various types of user input fields such as text, radio buttons, checkboxes etc.

TextBox

Textbox is used when user enter any data like numbers, words, sentences etc.

<head>

    <title>HTML Example</title>

</head>

<body>

    <form>

    Enter your name:<input type="text" />

    <br />

    Address:<input type="text" />

    </form>

</body>

</html>
 

 

Output

Enter your name:
Address:

Radio Button
 

Radio buttons are used for when we want  to select one option from a per-determined set of options.

HTML code:

 

<html>

<head>

    <title>HTML Example</title>

</head>

<body>

    <form>

    <input type="radio" /><br />

    <input type="radio" />

    </form>

</body>

</html>
 

 

Output



Checkboxs


Checkboxes are similar to radio buttons, but enable the user to make multiple selections.

 

<html>

<head>

    <title>HTML Example</title>

</head>

<body>

    <form>

    <input type="checkbox" /><br />

    <input type="checkbox" />

    </form>

</body>

</html>
 

 

Output




Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.