You can replace or modify your HTML using
.html(). However, the more likely scenarios is to add more information to the HTML, remove something, or append other elements. Let’s look at these examples next.
jQuery supports building parts of your HTML using code. Once you have a selection, you can use the methods
.append. This is true if your selection is an element node or the HTML content.
For example, the following code appends an additional
<li> item to the
navbar list from Listing 18.1.
$('#navbar').append('<li>Import ride date from race computer</li>');
As another example, suppose you want to work with each ...