0

I am working on a web application where I only have access to edit the css file. I am trying to grab the value (Ex: user23) of this div tag:

 <div id="username">user23</div>

Then use it in the css file to display the user's image.

 div.something {
        content: url(https://website.com/pic?id= /*user name will go here*/ );
 }

I have tried methods like attr() to grab the value but instead it grabs "username" instead of the value.

1 Answers1

0

You cannot do that with pure css. You should use JQuery and do something like that :

$("#theDiv").append("<img id='theImg' src='theImg.png'/>");