Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Created July 15, 2014 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdcauley/34f13231277e272daff2 to your computer and use it in GitHub Desktop.
Save jdcauley/34f13231277e272daff2 to your computer and use it in GitHub Desktop.
Placeholder for Gravity Forms
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