Opened 12 years ago
Closed 12 years ago
#9223 closed bug (worksforme)
Live blur focus
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | event | Version: | 1.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I cannot get the following script to work. The 'focus' function works, but the 'blur' function does not. I tried to run it with JsFiddle but to no avail.
Here is the script
function initiateFieldLabels(){ $("input.default").live({ focus: function() { var value =$(this).val(); if(!$('#'+$(this).attr('id')+'-default').length){ $(this).after('<input type=\"hidden\" id=\"'+$(this).attr('id')+'-default\" value=\"'+value+'\" />'); } $(this).val(''); $(this).removeClass('default') }, blur: function() { alert('hello'); var value = $('#'+$(this).attr('id')+'-default').val(); $(this).val(value); $(this).addClass('default'); } }); }
Change History (2)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | unfiled → event |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Here is an example:
http://jsfiddle.net/2Uq65/1/