Update: Safari 3 properly supports label tags, so this script is no longer necessary!
The Safari browser doesn't support clickable <label> tags. I've written a small JavaScript to use in conjunction with jQuery which makes the tags behave as they do in other browsers with support for onclick events and the following coding styles:
<label for="targetid">some text</label><element id="targetid" /><label><element /> some text</label><label>some text <element /></label>You may download version 20070405 in either commented or compressed form.
Include the JavaScript file on your page after your inclusion of jQuery. The labels will automatically be fixed. Here's a sample code excerpt:
[..] <head> <title>My Page Title</title> <script type="text/javascript" src="/js/jquery-1.1.2.pack.js"></script> <script type="text/javascript" src="/js/fix-safari-labels.jquery.js"></script> </head> [..]
Please Email Sunny Walker if you have any comments, suggestions or bug reports. Thank you.