HTML and CSS Reference
In-Depth Information
Listing 6-34. Event Handlers That Load the Appropriate Function Upon User Click
<a href="#" onclick="javascript:normal();" >
<img src="images/normal.png" alt="Normal font" title="Normal" />
<a href="#" onclick="javascript:larger();" >
<img src="images/larger.png" alt="Larger font" title="Larger" />
<a href="#" onclick="javascript:huge();" >
<img src="images/huge.png" alt="Huge font" title="Huge" />
Which function will run depends on which image link the user clicks.
Determining JavaScript Support
JavaScript support can be easily determined by a script with an alternate content such as in Listing 6-35.
Listing 6-35. JavaScript with Alternate Content
<script type="text/javascript">
document.write("If this text is displayed, your browser supports scripting, and
JavaScript is enabled!")
<noscript>JavaScript is NOT enabled!</noscript>
Browsers that do not support JavaScript will show the content of the noscript element.
The Most Common jQuery Functions
jQuery offers a variety of selectors to manipulate markup elements. The most common selectors are summarized in
Listing 6-36.
Listing 6-36. Common jQuery Selectors
// Select element by identifier
// Select element by CSS class
// Select elements that have an identifier with a string
// Select elements that have an identifier that begins with a string
// Select elements that have an identifier ending with a string
// Select elements of a particular type
Search WWH ::

Custom Search