Skip to content

Instantly share code, notes, and snippets.

View kylerush's full-sized avatar

Kyle Rush kylerush

  • New York, NY
View GitHub Profile
$('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).html());