In the <input> element with the type=”hidden”, the change() method of jQuery is not automatically triggered. The change() method is only triggered automatically when the user himself changes the value of the field and not the developer. When the developer changes the value inside the hidden field, he has to trigger the change as well.
There two possible way to detect the value change on the hidden input field:
- By using bind() method
- By using change() method
Below examples will illustrate both the methods to detect the change of value in the hidden field.
Example 1: The following example uses the inbuilt bind() method of jQuery.
Example 2: The following example uses the inbuilt change() method of jQuery.
- How to detect and change the content/style of a div using jQuery ?
- JQuery | Set the value of an input text field
- JQuery | Set focus on a form input text field on page load
- How to change Input characters to Upper Case while typing using CSS/jQuery ?
- How to detect the change in DIV's dimension ?
- How to detect a route change in AngularJS ?
- jQuery | :hidden Selector
- Get the height of the hidden element in jQuery
- How to check if an element is hidden in jQuery?
- HTML | DOM Input Hidden value Property
- HTML | DOM Input Hidden name Property
- HTML | DOM Input Hidden Object
- HTML <input type="hidden">
- How to create hidden form element on the fly using jQuery ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.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.