html
<div contentEditable="true">testing....</div>
jQuery
$(document).ready(function(){
$('[contenteditable]').removeAttr('contenteditable');
});
above codes is fine and working. you can feel it here.
Now, try this
$('[contentEditable]').removeAttr('contentEditable');
// notice the CamelCase of the string contentEditable
in FF 3.6, it gives an error on the console
An invalid or illegal string was specified" code: "12
elem[ name ] = value;
and the div is still editable.
I suspected it was the jQuery selector, but is not. By further inspection, it was the argument passed on the .removeAttr('contentEditable');
. It works when all small letters. So, I thought it should be all small letters. I'm curious so I tried adding CLass
as an attribute and do .removeAttr('CLass');
. But then it works without error.
So, how come contentEditable
is giving me that error?
update
from Kobi, it seems that it actually accept any case except, contentEditable
(I did try too).