Quote:
|
"If you don't feel like typing all this code, remember you can get a copy of it from the code download that goes with the book."
|
I think that's actually a "bug" in the book ;-) The code was there initially, but it's being replaced by a watermark plugin later in the chapter. Since the downloads contains the state of the application at the end of each chapter, this code isn't there. Anyway, the issue might be in this:
Code:
$(':input[type-text], textarea').each
It's type=text as you're filtering input controls whose type is text. For you reference, here's the complete code from the book:
Code:
<script type="text/javascript">
$(function()
{
$(':input[type=text], textarea').each
(
function()
{
var newText = 'Please enter your ' + $(this).parent().prev().text().toLowerCase().trim();
var$(this).attr('value', newText);
}).one('focus', function()
{
this.value = '', this.className = ''
}).addClass('Watermark').css('width', '300px');
});
</script>