Javascript examples for jQuery Method and Property:change
Trigger the change event for the selected elements:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("input").change(); });// w w w . ja va 2s.com }); </script> </head> <body> <button>Trigger change event for input field</button> <p>Enter your name: <input value="Mary" onchange="console.log(this.value)" type="text"></p> </body> </html>