Prev Demo
jQuery
>
.Add() - Add Element To Particular Element
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <header>This is the Heading</header> <p>The Paragraph starts here,</p> <div> <p>Something is Removed</p> </div> <script> $("div").add("p").append(" + This is added - ").css("color", "brown"); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output