Skip to content
Related Articles

Related Articles

HTML | DOM InputEvent inputType Property
  • Last Updated : 18 Jan, 2019
GeeksforGeeks - Summer Carnival Banner

The inputType property is used to know the type of change that is made to a particular input field or any other editable content by the event. It is a read-only property.

Syntax:

event.inputType

Return Value: It returns a string which indicates the type of input entered.

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>DOM InputEvent inputType Property</title>
</head>
      
<body style="text-align:center">
      
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
  
    <h2>DOM InputEvent inputType Property</h2>
  
    <textarea rows="2" id="myInput" 
              oninput="Geeks(event)">
          
    </textarea>
      
    <p>Input Type: <span id="p"></span></p>
      
    <script>
        function Geeks(event) {
            document.getElementById("p").innerHTML = 
                                   event.inputType;
        }
    </script>
      
</body>
</html>                    

Output:
inputtype

Supported Browsers: The browser supported by inputType Property are listed below:

  • Apple Safari
  • Google Chrome 60.0
  • Firefox Not supported
  • Opera 47.0
  • Internet Explorer Not supported

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :