2 under used HTML attributes
Aug. 10, 2025
#css
#html
1. user-select
user-select
controls if and how a user can select text. It seems like it would be very cool for elements that you expect to be copy & pasted a lot.
MDN docs.
Usage Example: <p style="user-select:all">
user-select: none
user-select: text
user-select: all
2. contenteditable
contenteditable
makes an html element editable. With the right JavaScript, you could probably make some pretty cool "live editors".
MDN docs
contenteditable="true"
will retain all formatting for pasted elements.contenteditable="plaintext-only"
removes formatting from pasted elements.
Editable to-do list
Click to edit:
- [ ] Wash the dishes
- [ ] Get groceries