August 2015
Beginner
1075 pages
40h 42m
English
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 .remove, .replaceWith(), .before, .after, .prepend, and .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 ...
Read now
Unlock full access