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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 42
    Comment on it

    The html() method is used to return the content  of a particular  elements and it returns the content of first matched element. It overwrites the content of matched elements.


     

    <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    <script>
    $(document).ready(function(){
        $("button").click(function(){
            $("p").html("Hello <b>evon Tech!</b>");
        });
    });
    </script>
    </head>
    <body>
    
    <button>Life is more beautiful than you</button>
    
    <p>This is a paragraph.</p>
    <p>Evon Tech Dehradun.</p>
    
    </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: