Get an attribute:
attributeValue = $(this).attr('attributeName'); |
Checkbox value:
if ($(#elementId).is(':checked')) { } |
Remove an attribute:
$('#elementId').removeAttr('attributeName'); |
Set an attribute:
$('#elementId').attr('attributeName', 'attributeValue'); // jQuery < 1.6 $('#elementId').attr('checked', false); $('#elementId').attr('disabled', 'disabled'); jQuery > 1.5 $('#elementId').prop('checked', true); $('#elementId').prop('checked', false); $('input[name^=elementName]').attr('disabled', 'disabled'); |