Skip to content

Instantly share code, notes, and snippets.

@dannylloyd
Created March 5, 2012 16:10
Show Gist options
  • Select an option

  • Save dannylloyd/1979045 to your computer and use it in GitHub Desktop.

Select an option

Save dannylloyd/1979045 to your computer and use it in GitHub Desktop.
Displays the id of an input on top of the input as a span tag
$('input[type=text],input[type=password]').each(function(e, ob) {
var input = $(ob);
var id = input.attr('id').replace('ctl00_ContentPlaceHolder1_','');
var parent = input.parent();
var left = input.position().left + 2;
var top = input.position().top;
var idcallout = '<span id="span' + id + '" style="position: absolute; top: ' + top +'px; left: ' + left + 'px;">' + id + '</span>';
$(parent).append(idcallout);
});​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment