// Now create a new button element with the alert class. This button
// was created after the click listeners were applied above, so it
// will not have the same click behavior as its peers
$( "button" ).addClass( "alert" ).appendTo( document.body );
This is a selector to access the existing buttons, not creating a new element. Code should pass HTML:
$( "<button>" ).addClass( "alert" ).appendTo( document.body );