How do we set the type of element in HTML?

HTMLWeb DevelopmentFront End Technology

Use the type attribute to in HTML to set the type of element.

Let us learn about the <input> tag, which helps you to take user input using the type attribute. The attribute is used with the form elements such as text input, checkbox, radio, etc.


You can try to run the following code to implement type attribute −

<!DOCTYPE html>
      <title>HTML Forms</title>
      <p>Add your details:</p>
         Student Name:<br> <input type = "text" name = "name">
         Student Subject:<br> <input type = "text" name = "subject">
         Rank:<br> <input type = "text" name = "rank">
Published on 14-Mar-2018 15:55:21