Sitemap
Abi Suresh

Abi Suresh

HTML Tags

4 min readDec 1, 2022

--

Placeholder Attribute

The placeholder attribute specifies a short hint that describes the expected value of an input field.

The short hint is displayed in the input field before the user enters a value.

<input placeholder="text">

text- Specifies a short hint that describes the expected value of the input field.

Name Attribute

The name attribute specifies a name for an HTML element.

This name attribute can be used to reference the element in a JavaScript.

For a <form> element, the name attribute is used as a reference when the data is submitted.

For an <i frame> element, the name attribute can be used to target a form submission.

<form>
Choose your favorite subject:
<button name="subject" type="submit" value="HTML">HTML</button>
<button name="subject" type="submit" value="CSS">CSS</button>
</form>

Value Attribute

The value attribute specifies the value of an <input> element.

The value attribute is used differently for different input types:

  • For button, reset, and submit — it defines the text on the button
  • For text, password, and hidden — it defines the initial (default) value of the input field
  • For checkbox, radio, image — it defines the value associated with the input (this is also the value that is sent on submit)
<input value="text">

Label Tag

The <label> tag defines a label for several elements.

The label text is not only visually associated with its corresponding text input.

<form>
<label for="html">HTML</label><br>
</form>

Radio Attribute

Radio buttons are normally presented in radio groups. The radio group must have share the same name to be treated as a group. Once the radio group is created, selecting any radio button in that group automatically deselects any other selected radio button in the same group.

The value attribute defines the unique value associated with each radio button.

<input type="radio">

Form Tag

<form></form> — form tag used to create a form.

<form action=” ”> — Target attribute where to display the response that is received after submitting the form.

<form method=” ”> — Method attribute specifies the HTTP method to be used when submitting the form data.

form id — specifies the form element the <select> element belongs to. The value of this attribute must be equal to the id attribute of a <form> element in the same document.

<textarea> </textarea>— defines a multi line text field.

<button></button> — <button type=”submit” value=”submit”> Submit </button>

<fieldset> — The fieldset tag is used to group related elements in a form. The fieldset tag draws a box around the related elements.

<legend> — The legend tag defines a caption for the <fieldset> element.

<datalist> — The <datalist> tag specifies a list of pre-defined options for an <input> element. The <datalist> tag is used to provide an auto complte feature for <input> elements. Users will see a drop-down list of pre-defined options as they input data.

<output> — The <output> html element is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.

Get Abi Suresh’s stories in your inbox

Join Medium for free to get updates from this writer.

<option> — The content between the opening <option> and closing </option> tags is what the browser will display in a drop-down list.

<optgroup> — The <optgroup> tag is used to group related options in a <select> element (drop-down list). If you have a long list of options, groups of related options are easier to handle for a user.

<div> — The <div> tag defines a division or a section in an html document By default, browsers always place a line break before and after the <div> element.

<form action="/action_page.php" method="get">
<input type="checkbox" name="vehicle1" value="Bike">
<label for="vehicle1"> I have a bike</label><br>
<input type="checkbox" name="vehicle2" value="Car">
<label for="vehicle2"> I have a car</label><br>
<input type="checkbox" name="vehicle3" value="Boat" checked>
<label for="vehicle3"> I have a boat</label><br><br>
<input type="submit" value="Submit">
</form>

Some other input elements.

<input> — element can be displayed in many ways, depending on the type attribute.

<input type=”text”> — Displays a single line text input field.

<input type=”radio”> — Displays a radio button (for selecting one of many choices)

<input type=”checkbox”> — Displays a checkbox (for selecting zero or more of many choices)

<input type=”submit”> — Displays a submit button (for submitting the form)

<input type=”button”> — Displays a clickable button

<input type=”color”>

<input type=”date”>

<input type=”date time-local”>

<input type=”email”>

<input type=”file”>

<input type=”month”>

<input type=”number”>

<input type=”password”>

<input type=”radio”>

<input type=”range”>

<input type=”search”>

<input type=”tel”>

<input type=”time”>

<input type=”url”>

<input type=”week”>

Table

<table></table> tag used to create a table.

<tr></tr> tag used to create a table rows.

<th></th> tag used to create row headings

<td></td> tag used to insert data

<caption> tag used to insert caption

<thead></thead> — The <thead> tag is used to group header content in an html table.

<tbody></tbody> — The <tbody> tag is used to group body content in an html table.

<tfoot></tfoot> — The <tfoot> tag is used to group body content in an html table.

rowspan — rowspan attribute specifies the number of rows a cell should span.

colspan — The value of the colspan attribute represents the number of columns to span.

<caption></caption> — The <caption> tag defines a table caption.

<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</table>

--

--