What\'s the difference between the following two pieces of HTML (apologies if there are any typos as I\'m typing this freehand)?
Using jQuery:
It is also a cleaner separation of UI code (the HTML) and the logic code (the JavaScript). It makes reading each a bit easier.