Created
July 15, 2014 16:00
-
-
Save jdcauley/34f13231277e272daff2 to your computer and use it in GitHub Desktop.
Placeholder for Gravity Forms
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
function placeholder(){ | |
var target = '#gform_1 input[type=text]'; | |
var inputs = document.querySelectorAll(target); | |
if(inputs){ | |
for (var i = 0; i < inputs.length; i++){ | |
var value = inputs[i].value; | |
console.log(value); | |
inputs[i].value = "" | |
inputs[i].placeholder = value; | |
} | |
} | |
} | |
placeholder(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment