Set color value to initial - HTML CSS CSS

HTML CSS examples for CSS:Introduction

Description

Set color value to initial

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
div {<!--  ww w .  j a  v a2s  .  c o m-->
    color: red;
}
</style>
</head>
<body>

<div>
  <h1 id="bc">Hello World</h1>
  <ul>
    <li id="a">Item one</li>
    <li id="b">Item two</li>
    <li id="c">Item three</li>
  </ul>
</div>

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
    document.getElementById("b").style.color = "initial";
}
</script>

</body>
</html>

Related Tutorials