Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

HTML | DOM InputEvent inputType Property

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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
My Personal Notes arrow_drop_up
Last Updated : 18 Jan, 2019
Like Article
Save Article
Similar Reads
Related Tutorials