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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 47
    Comment on it

    This method is used to change the content of the elements . It change only selected elements .It can also replaces the selected content with new content.It doesn't take any arguments.
    Syntax :


    Return content :

    $(selector).html(content) // It return the content of the all matched elements

    Set Content :

    $(selector).html(function(index, currentcontent)) // It is used to overwrites the content of all the matched elements

    Example :
    HTML Code :

    <button>Click here to see the change of selected contents of matched elements</button>
    <p>It will change after click on button</p>

    jQuery Code :


    Output :
    Before jQuery :

    It will change after click on button

    After jQuery :

    Hello Mukesh // Content of p has been changed

 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: