3
I have the following code:
<div class="chatUsers" name="chatUsers" id="1">
<div class="chatImageUser" style="background: url('https://vignette.wikia.nocookie.net/starwars/images/2/20/LukeTLJ.jpg/revision/latest?cb=20170927034529');"></div>
<div class="chatNomeUser">Luke Skywalker</div>
<div class="chatStatusUser">
<div class="chatStatusUserBall"></div>
<div class="chatStatusUserMessage">Online</div>
</div>
</div>
How could I capture the value of background: url('')
of the element that has id=1
?
I tried it this way, but it didn’t work:
var urlFoto = $("#1 > .chatImageUser").css('backgroundUrl');
Try $('.chatImageUser'). attr('style'); I’ll check another way
– Wilson Rosa Gomes