Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • jQuery toggle( ) Method

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 51
    Comment on it

    This method is used to work with multiple functions i.e when you click on selected element first function will be fired and when you click on that selected element second function will be called and so on.
    Syntax :


    Parameter :
    function : A function will fired every time on click the selected element.

    HTML Code :

    <p>Click me.</p>

    jQuery Code :

    <script src="">
            function(){$("p").css({"color": "red"});},
            function(){$("p").css({"color": "blue"});},
            function(){$("p").css({"color": "green"});

    Output :
    Click me // when you click first time its color changed to red , on clicking second time its color change to blue, on third time it's color changed to green.

 0 Comment(s)

Sign In

Sign up using

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: