Asking for a friend........
I joke. I'm just curious to see there are any decent online javascript code checkers out there. I've tried a few but they all return that the following statement is correct:
document.getElementByID('dob').removeAttribute('readonly', 0);
Obvs if you have CI then this isn't really an issue but sometimes that's a bit overkill and this is for the times when CI doesn't exist.
If not maybe it would be good for someone to try and create - if peeps have the time?
Trent Haynes
Weeks of coding and can save you hours of planning.
I've found 2 different references for the removeAttribute method. The most common reference indicates only requiring the attribute name. The other reference includes a second, optional parameter of value 0, 1 or 2.
Given that I don't know which is canonical (or if canonical even exists), my default will almost always be to use the MDN documentation (which does not reference the optional parameter).
The optional parameter does not fail when I try it in JsFiddle, or my browser.
Can you elaborate on the issue? Is the version with the optional parameter deprecated? Was it proposed and not formally adopted? I was not able to find a definitive answer.