Gunnar Bittersmann: speichern src in iframe

Beitrag lesen

@@Rolf B

  • createElemente("IMAGE") funktioniert nicht in HTML.

Aber vielleicht (ohne das zuviele e) in JavaScript? 😉 Denn <image> funktioniert in HTML – es ist seit jeher ein Synonym für <img>.

Zum Stylen kann man aber nicht den Selektor image verwenden, es muss img sein, wovon man sich in diesem Codepen überzeugen kann. Das <image>-Tag generiert ein img-Element (HTMLImageElement [sic!][1]) im DOM.

Tut das document.createElement("image") auch? Nope. Wovon man sich auch im Codepen überzeugen kann. Damit wird ein image-Element generiert, was sich wie ein span verhält, d.h. die im src-Attribut angegebene Bildressource nicht als Bild darstellt.

🖖 Live long and prosper

--
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14

  1. Der Bezeichner rundet die Konfusion ab. ↩︎