By 15/02/2016 15 Comments

Change Element’s Multiple Classes In JavaScript

Example:

<script>
function cssChange(){
 document.getElementById("heading").className += " my-class-one";
 document.getElementById("heading").className += " my-class-two";
}
</script>

<style>
.default-style { color:red }
.my-class-one { text-decoration:underline}
.my-class-two { font-style:italic }
</style>

<body>
 <h2 class="default-style" id="heading">Tutorialstown.com</h2><br>
 <button onclick="cssChange()"> Change Css Class </button>
</body>






Posted in: HTML, JavaScript, Solutions

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .