I'm trying to implement a simple watermark on a text box that disappears when the text box gains focus. I found this jQuery plugin that appeared to work great:
http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/
The watermark worked just as advertised with this code:
<script type="text/javascript" src="/includes/_jQuery/_Library/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="/includes/_jQuery/_plugs/_hint/jquery.hint.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("input[title!=]").hint();
});
</script>
<table>
<tr>
<td><input type="text" title="Blah" /></td>
</tr>
</table>
However, when adding an alert to the click event of the table, I found that the event doesn't bubble up when you click on the portion of the text box that has text. However it bubbles up just fine when you click on the part of the text box without text. Here is the jQuery code that I used to create the alert:
$("table").click(function() {
alert("blah");
});
Does anybody have any idea why the event doesn't bubble up when part of the text box is clicked, but not the other?