Thursday, 25 September 2014

How to add segment insertAfter specific id in jQuery?

<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("<p id=3>Hello world!</p>").insertAfter("#1"); }); }); </script> </head> <body> <button>Insert span element after each p element</button> <p id="1">This is a paragraph.</p> <p>This is another paragraph.</p> </body> </html>

No comments:

Post a Comment

Feet/Inches to Meters Converter & Lbs to Kgs Converter

 <!DOCTYPE html> <html lang="en"> <head>   <meta charset="UTF-8" />   <title>Feet/Inches ⇄...