[ACCEPTED]-To have `removeID` for jQuery like `removeClass`-jquery

Accepted answer
Score: 17
$('.question_box').removeAttr('id')

More info at http://docs.jquery.com/Attributes/removeAttr

0

Score: 6

removeClass only exists because class is a multi-valued 5 attribute... if you have a <div class="one two three"> and you call 4 .removeClass("two") on it, it should end up with class="one three". addClass and removeClass exist 3 to save you from doing all that work yourself. id isn't 2 special in that way, so you just access 1 it with attr.

Score: 0

Remove class:

$('.question_box').removeClass('nameClass');

Remove id:

$('.question_box').removeAttr('id');

0

More Related questions