coiso
coiso

Reputation: 7479

ctrl+c "content" from css

trying to create a flexible mailing list with little JS:

.email_item::after {
     content: ", ";
}

resulting in:

[email protected], [email protected]

replicating with ctrl+c and ctrl+v returns:

[email protected]@mail.com

I'm going to have to use JS right? Or is there an optimizing genius out there?

Upvotes: 2

Views: 328

Answers (1)

Gabriele Petrioli
Gabriele Petrioli

Reputation: 196236

Yes, generated content like :after and :before is for display purposes only.
It does not alter the DOM so it is not selectable..

Why use JS and not directly add the comma at the HTML ?

Quoting the specs about content

Generated content does not alter the document tree. In particular, it is not fed back to the document language processor (e.g., for reparsing).

Upvotes: 5

Related Questions