Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $(function() {
- $('#selector').each(function(){
- var text = $(this).val();
- $(this)
- .focusin(function(){
- $(this).addClass('focus');
- if ($(this).val() == text) $(this).val('');
- })
- .focusout(function(){
- if ($(this).val() == '') $(this).val(text);
- $(this).removeClass('focus');
- });
- });
- })
- })(jQuery)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement