jQuery DOM Manipulation .html()

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

You can use this method to replace all of the HTML within the selector. Assuming you have an html element like this

<div class="row">
    <div class="col-md-12">
        <div id="information">
            <p>Old message</p>
        </div>
    </div>
</div>

You could use .html(). to remove and add an alert or informational text to alert users all with one line.

$("#information").html("<p>This is the new alert!</p>");


Got any jQuery Question?