Because you can manipulate attributes without destroying and recreating elements. Changing <h level=1> to <h level=2> is a much simpler and different thing to changing <h1> to <h2>.
An alternative approach to 100% trusting the browser to calculate the level. You can calculate and adjust as needed.
Can you explain in what ways it is simpler to change 1 to 2 in the first case? Is it that you are mutating them via script and it seems more "normal" to mutate a property of a tag instead of the tagname?
Or is it because it might have a named closing tag and you have to update both?
tyingq|9 years ago
An alternative approach to 100% trusting the browser to calculate the level. You can calculate and adjust as needed.
esrauch|9 years ago
Or is it because it might have a named closing tag and you have to update both?