HTML type attribute

type attribute represents the type of list item markers, the type of embedded resources or the type of butoon (submit, reset, button).

Example

<ol type="A">
  <li>Mix both solutions</li>
  <li>Stir them well.</li>
  <li>Add a few drops of the sulphuric acid.</li>
  <li>Heat it up to 20 minutes at 88 Celsius temperature.</li>
 </ol>
Try </>

type attribute value

There are many values of type attribute that behave differently for different tags.

For example, text/html, text/css, text/js, video/mp4, audio/mp3, image/jpg, submit, reset.

Related tags

The tags that support type attribute are given below.

<button> tag

It defines a button. The type of button may be 'submit', 'reset'.

<button type="submit" name="submit">submit</button>
<button type="reset" name="reset">reset</button>

The reset keyword resets the values in input controls. And the input fields become empty.

<object> tag

<object src="files/start.html" type="text/html"> </object>

<embed> tag

It embeds external resources (image, html pages).

<embed src="files/web.png" type="image/png">

<script> tag

script tag adds scripting language in the page.

<script src="files/js.js" type="text/js"> <script>

<source> tag

source tag is nothing on its own. But it is useful when used with other elements.

<audio>
 <source src="fiels/sample.mp3" type="audio/mp3">
</audio>

<style> tag

style tag specifies the CSS properties to style the content.

<style type="text/css">
.styled-div{
	display:block;
	font-size:20px;
	padding:20px;
}
</style>

<ol> tag

ol means ordered lists. See the above given example.




Was this article helpful?

 

Email:

Message:

Get the newsletter