How can I change the CSS property ::before
in JavaScript?
My CSS code looks like this:
#all-address::before
{
content: '';
height: 20px;
background: linear-gradient(to bottom, transparent 0%, white 45%, white 100%);
z-index: 3;
display: none;
}
Now I want change display: none
to display: block
with help of JavaScript.
I tried this code but it doesn't seem to work:
var div = document.getElementById("all-address");
div.pseudoStyle("before", "display", "block");