When editing an element with the contenteditable attribute I want the background color of that element to change colors. For example, if the element background color was dark grey I would want it to turn white while editing the element and then reset back to dark grey when done editing.
You can use this CSS:
[contenteditable="true"] {
background-color: grey;
}
[contenteditable="true"]:focus {
background-color: white;
}
Here's the JSFiddle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With