if (navigator.userAgent.indexOf('Safari') != -1) { window.addEventListener('load', function() { var lock = false; var labels = document.getElementsByTagName('label'); for (var i = 0; i < labels.length; i++) labels[i].addEventListener('click', function() { var input = (this.htmlFor ? document.getElementById(this.htmlFor) : this.getElementsByTagName('input')[0]); if (input && !lock) { input.focus(); lock = true; input.click(); lock = false; } }); }); }
Never been to CodeSnippets before?
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Safari
You need to create an account or log in to post comments to this site.
Related Posts
» jQuery accordion in javascript js jquery ui accordion
» Watch YouTube videos with Qu... in shell osx mac bash javascript plugin safari video youtube quicktime greasekit simbl mp4
» translate JavaScript bookmar... in osx mac javascript bookmarklet safari web internet bookmark
» Javascript todo-list sorter in javascript
» Validate a url in javascript
» Creating nodes with Javascri... in javascript dom
Snippets (source code soon to be available) developed by Peter Cooper and powered by Ruby On Rails