TAG
CSS
JavaScript
Result
Run
License
<h1 id="title" style="color: #0000FF; font-weight: normal;"> The getPropertyPriority() Method </h1> <button type="button" id="btn-get">What color of font color?</button> <p></p>
#btn-get { font-size: 15px; } p { color: #FF0000; }
window.addEventListener("load", function() { document.querySelector("#btn-get").onclick = function() { var color = document.querySelector("#title").style.getPropertyValue("color"); document.querySelector("p").textContent = color; }; });
Console
expand_less
License
License
by DevDic
Close