first of all my english is not so good but i believe it will be enough for defining myself.
In style.css file
div.myclass
{
width:20%;height:350px;background-color:#097;float:left;margin-right:5px;
}
in html file
<link rel="stylesheet" type="text/css" href="style.css">
<div class="myclass"></div>
<div class="myclass"></div>
<div class="myclass"></div>
U see, i have this divs and i want to change them background image with jquery.
I tried to use .css() function for it
$('div.myclass').css({'background-image':'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVQIW2P8DwSMIMAABQA+HQQDNlbHLwAAAABJRU5ErkJggg==)'})
But function changing div to this
<div class="myclass" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVQIW2P8DwSMIMAABQA+HQQDNlbHLwAAAABJRU5ErkJggg==);"></div>
<div class="myclass" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVQIW2P8DwSMIMAABQA+HQQDNlbHLwAAAABJRU5ErkJggg==);"></div>
<div class="myclass" style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVQIW2P8DwSMIMAABQA+HQQDNlbHLwAAAABJRU5ErkJggg==);"></div>
I'm asking how can i change div css rule inside the stylesheet file
div.myclass
{
width:20%;height:350px;background-color:#097;float:left;margin-right:5px;
}
to this
div.myclass
{
width:20%;height:350px;background-color:#097;float:left;margin-right:5px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEElEQVQIW2P8DwSMIMAABQA+HQQDNlbHLwAAAABJRU5ErkJggg==);
}