Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('label').each(function() {
- var label = $(this);
- var element = $('#'+ label.attr('for'));
- var position = element.position();
- label.css('position', 'absolute').css('left', position.left + 10).css('top', position.top - 8);
- element.focus(function() {
- label.fadeOut(100);
- });
- element.blur(function() {
- if (element.val().length == 0) {
- label.fadeIn(100);
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement