How to append an text message when an input field is modified in jQuery ? Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will see how to append an element with a text message when an input field is changed in jQuery. To append an element with a text message when the input field is changed, change() and appendTo() methods are used. The change() method is used to detect the change in the value of input fields. This method works only on the “<input>, <textarea> and <select>” elements. The appendTo() method is used to append the elements. Syntax: $($selector).change(function() { }) Here, first we use change() method to detect the changes of the input field and appendTo() method is used to display the message. Example: HTML <!DOCTYPE html> <html> <head> <title> How to append an element with a text message when an input field is changed in jQuery? </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <script> $(document).ready(function () { $("#textInput").change(function () { $("<p>Input text has changed.</p>") .appendTo("body"); }); }); </script> <style> body { text-align: center; } h1 { color: green; } .clickable_ele { font-size: 20px; font-weight: bold; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h3> How to append an element with a text message <br>when an input field is changed in jQuery? </h3> <form action="#"> <input id="textInput" type="text" value="GeeksforGeeks"> </form> </body> </html> Output: Create Quiz Comment V vkash8574 Follow 0 Improve V vkash8574 Follow 0 Improve Article Tags : Web Technologies JQuery HTML-Tags CSS-Properties jQuery-Questions +1 More Explore jQuery Tutorial 7 min read Getting Started with jQuery 4 min read jQuery Introduction 7 min read jQuery Syntax 2 min read jQuery CDN 4 min read jQuery SelectorsJQuery Selectors 5 min read jQuery * Selector 1 min read jQuery #id Selector 1 min read jQuery .class Selector 1 min read jQuery EventsjQuery Events 4 min read jQuery bind() Method 2 min read jQuery blur() Method 1 min read jQuery change() Method 2 min read jQuery EffectsjQuery animate() Method 2 min read jQuery clearQueue() Method 2 min read jQuery delay() Method 2 min read jQuery HTML/CSSjQuery addClass() Method 2 min read jQuery after() Method 1 min read jQuery append() Method 2 min read jQuery TraversingjQuery | Traversing 4 min read jQuery add() method 1 min read jQuery addBack() Method 2 min read Like