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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 100
    Comment on it

    add class( ) event is used to add class in a element during run time.It helps in animating designs.Through this we can change the property during run time.

     

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>addClass demo</title>
      <style>
      p {
        margin: 8px;
        font-size: 16px;
      }
      .selected {
        color: blue;
      }
      .highlight {
        background: yellow;
      }
      </style>
      <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
    </head>
    <body>
     
    <p>Hello</p>
    <p>and</p>
    <p>Goodbye</p>
     
    <script>
    $( "p" ).last().addClass( "selected" );
    </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: