Skip to content

Instantly share code, notes, and snippets.

@cheapsteak
Created July 8, 2014 21:52
Show Gist options
  • Save cheapsteak/951bd07b8c9170e79d6c to your computer and use it in GitHub Desktop.
Save cheapsteak/951bd07b8c9170e79d6c to your computer and use it in GitHub Desktop.
Get Google Form field names
var fields = {};
[].slice.call($$('input[id^="entry_"]')).forEach(function (el) {
var name = el.getAttribute('name');
var label = el.getAttribute('aria-label').trim();
fields[label] = name;
});
console.log(JSON.stringify(fields));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment