over 8 years ago
add( ) event is used to add elements css to the matched set of elements.Through dis we can change the css and add add text to the matched set of elements.It helps in making site more user friendly and interacting.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>add demo</title> <style> div { width: 60px; height: 60px; margin: 10px; float: left; } p { clear: left; font-weight: bold; font-size: 16px; color: blue; margin: 0 10px; padding: 2px; } </style> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <p>Added this... (notice no border)</p> <script> $( "div" ).css( "border", "2px solid red" ) .add( "p" ) .css( "background", "yellow" ); </script> </body> </html>
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)