Welcome aboard! We are happy you are here and wish you good net-raft!
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<button onclick="getcolor()">Click</button>
<p style="background-color: orange;">Hello world!</p>
<script type="text/javascript">
function getcolor() {
var color = document.getElementsByTagName("p")[0].style.backgroundColor;
alert(color);
}
</script>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507