Knowledge Walls
Ammu
Hyderabad, Andhra Pradesh, India
Passcode:
For Changing attribute:Class in Examples of Javascript 1
751 Views
Example
<!DOCTYPE html>
    <html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <title>attribute class</title>
        <style>
        .greencolor{
        color: green;
        }
        .redcolor{
        color: red;
        }
        </style>
    </head>
    <body>
        <button class="greencolor"  onclick="document.getElementById('color').className = 'greencolor'" >Green</button>
        <button class="redcolor" onclick="document.getElementById('color').className = 'redcolor'" >Red</button>
        <p id="color">color change</p>
    </body>
</html>
Previous Topics
Previous lessons of current book.
Examples of Javascript 1
Best Lessons of "Javascript 1"
Top lessons which are viewed more times.
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
Examples of Javascript 1
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details