Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11161 closed bug (invalid)

jquery 1.7.1 min - attr

Reported by: bratva@… Owned by:
Priority: low Milestone: None
Component: attributes Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

<span id="enable">Enable input</span>
<input id="test" type="text" name="a[]" disabled=disabled />

$('#enable').click(function(){
  $(this).next().attr('disabled','');
  alert($(this).next().attr('disabled'));
  // disabled!!! bug or I'm idiote? 
})

Change History (1)

comment:1 Changed 7 years ago by timmywil

Component: unfiledattributes
Priority: undecidedlow
Resolution: invalid
Status: newclosed

The mere presence of the disabled attribute indicates true for its boolean property. Setting to empty string does not change its behavior. Instead, you can do .removeAttr('disabled'), but I recommend looking into http://api.jquery.com/prop to set the actual property.

Note: See TracTickets for help on using tickets.