
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
jQuery after() Method
The after() method in jQuery is used to insert specified content after the selected elements.
Example
Let us now see an example to implement the jQuery after() method −
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("#btndemo").click(function(){ $("img").after("<strong>Text inserted after!</strong>"); }); }); </script> </head> <body> <img src="https://www.tutorialspoint.com/images/tp-logo-diamond.png" alt="Tutorialspoint Logo" width="220" height="120"><br><br> <button id="btndemo">Insert specified content</button> </body> </html>
Output
This will produce the following output −
Click on the above button to display the text −
Advertisements