-
-
Save Shagshag/3dfc75ced9a46ba4af3b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$("form :input").each(function(index, elem) { | |
var eId = $(elem).attr("id"); | |
var label = null; | |
if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) { | |
$(elem).attr("placeholder", $(label).text()); | |
$(label).remove(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment