I know that img.align
is deprecated or even obsolete, still ... Firefox is changing the values of my attributes. In particular see example
const img = document.querySelector("img");
console.log("img.align:", img.align);
<img src="http://www.gravatar.com/avatar" align="center" >
results:
- chrome:
img.align: center
- firefox:
img.align: middle
Any idea why firefox changes the value of the attribute? Are there other attribute values firefox changes?
This has implications for code like
document.querySelectorAll("img[align=center]")
Which fails on Firefox (only) and so would any CSS using the same selector; img[align=center] { ... }
, for example.
Possibly relevant: Can I add custom attribute to HTML tag?