Created
January 27, 2014 22:30
-
-
Save nitishn/8658630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this script adds a "for" attribtue to wildfire form elements which have labels | |
// this allows for easier CSS styling. | |
// | |
var inputs = $(":input").not(":checkbox").not(":hidden").not(":submit").not(":button") | |
$.each( inputs, function( index, element ) { | |
var elementLabel = $(this).parents("ol").find('label').html(); | |
if( elementLabel ) { | |
elementLabel = elementLabel.replace(/\s/g, ''); | |
} | |
$(element).attr("for", elementLabel); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment