JQuery – Spoiler tutorial

From the book: JQuery, page 98

A simple JQuery example is the ‘spoiler’ – a button that shows and hides content. To achieve this effect, you need to place the following functions in your header. Within the document, the query will search for a div ID called ‘spoiler’ (this is the target – the object that will be affected). It will also search for two objects (in this case buttons) called #show and #hide. The function at the top that is not looking for a ‘click’ is there to ensure no content is visible as the page loads – #spoiler loads hidden.