HTML | DOM InputEvent inputType Property

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>                    

chevron_right


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


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.