I have one question about using variable (time2 in my case) in data-title CSS field. This is example what i need : http://jsfiddle.net/9oydvza0/1/ What shall i do that this variable takes value id time2?
Code from link : CSS:
<style>
.photo4 {
display: inline-block;
position: relative;
}
.photo4:hover:after {
display: block;
content: attr(data-title-id);
position: absolute;
left: 120%;
bottom: -250%;
z-index: 1;
background: #003399;
font-family: Segoe UI;
font-weight: lighter;
font-size: 13px;
padding: 5px 10px;
color: #fff;
border: 1px solid #333;
-moz-border-radius: 5px -webkit-border-radius: 5px;
border-radius: 5px 5px 5px 5px;
}
</style>
Javascript:
<script>
document.getElementById("time2").innerHTML = "ololo";
</script>
HTML:
<p id="time2"></p>
<div style="width:10px; float:left; padding-top:20px;">
<div class="photo4" data-title-id="time2">
<img src="http://placekitten.com/g/300/300" width="22" height="22px" />
</div>
</div>
</div>
css selectorfortime2or something else?#time2? I don't really get your question...