Created
March 5, 2012 16:10
-
-
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
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
| $('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