In my JS I'm trying to access the 'content' property of the dislpay_object::before class. I need to set the 'content' (text) to the placement of the div on the page.
I've done tons of searching but haven't found anything this in depth on these types of pseudo classes.
.display_object {
position: absolute;
border: thin solid black;
width: 15cm;
white-space: nowrap;
}
.display_object:active::before {
content: "x,y";
/*needs to be changed to actual values*/
display: block;
position: absolute;
background: rgba(0, 0, 0, 0.48);
padding: 1em 3em;
color: white;
font-size: .8em;
bottom: 1.6em;
left: -1px;
white-space: nowrap;
}
How can I reference the .content of the :active::before through JS, to set it to its current position?