css - How to highlight text in chrome -
i highlight text in chrome conditionnaly. website using type of code each element on page , highlight lenght lower 1:00:00
<div class="entry_content"> <p> "title" <br> <a href="a link" target="_blank"> <img src="alink.jpg" alt="name"> </a> <br> size: 11111111 bytes (111.11 mb), duration: 00:11:11, avg.birate: 111 kb/s <br> audio: aac, 16000 hz, mono <br> video: h264, 320×240, 15 fps </p> </div>
ps: know number don't add it's example ;)
i if possible in css stylish dont know if it's possible , how make condition in css.
thank help.
i can't see way use css conditionally highlight element based on content. however, simple bit of javascript it:
var divs = document.getelementsbyclassname("entry_content"); (var = 0; < divs.length; i++) { if (/duration:\s00:/.test(divs[i].innerhtml)) { divs[i].style.backgroundcolor = "yellow"; } }
<div class="entry_content"> <p> "one hour eleven minutes" <br> <a href="a link" target="_blank"> <img src="alink.jpg" alt="name"> </a> <br> size: 11111111 bytes (111.11 mb), duration: 01:11:11, avg.birate: 111 kb/s <br> audio: aac, 16000 hz, mono <br> video: h264, 320×240, 15 fps </p> </div> <div class="entry_content"> <p> "eleven minutes" <br> <a href="a link" target="_blank"> <img src="alink.jpg" alt="name"> </a> <br> size: 11111111 bytes (111.11 mb), duration: 00:11:11, avg.birate: 111 kb/s <br> audio: aac, 16000 hz, mono <br> video: h264, 320×240, 15 fps </p> </div> <div class="entry_content"> <p> "eleven hours" <br> <a href="a link" target="_blank"> <img src="alink.jpg" alt="name"> </a> <br> size: 11111111 bytes (111.11 mb), duration: 11:11:11, avg.birate: 111 kb/s <br> audio: aac, 16000 hz, mono <br> video: h264, 320×240, 15 fps </p> </div>
Comments
Post a Comment