573
(lemm.ee)
you are viewing a single comment's thread
view the rest of the comments
[-] dukk@programming.dev 1 points 3 months ago

Trailing slash lets you do this though:

For example, in the case of <div/>Some text, browsers interpret this as <div>Some text</div>, treating the slash as ignored and considering the div element to encapsulate the text that follows.

[-] KairuByte@lemmy.dbzer0.com 5 points 3 months ago

This is terrible.

You should never rely on a browser interpreting a non standard use in a specific way. It can change at any moment, and wouldn’t be reliably reversed because it’s inherently non standard.

[-] lseif@sopuli.xyz 3 points 3 months ago

Why would you want that.

this post was submitted on 20 Jul 2024
573 points (100.0% liked)

Programmer Humor

19452 readers
10 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS