Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • add( ) event jquery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 142
    Comment on it

    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>

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: