
Untitled
By: a guest on
Aug 10th, 2012 | syntax:
None | size: 1.15 KB | hits: 7 | expires: Never
Multiple javascript buttons (Enable/Disable)
// Left Menu function controls(className) {
if (className == "red") {
document.getElementById('Skip').setAttribute('class','green');
// You can define your play music statements here
} else {
document.getElementById('Skip').setAttribute('class','red');
// You can define your stop music statements here
} }
if (className == "red1") {
document.getElementById('Text').setAttribute('class','green1');
// You can define your play music statements here } else {
document.getElementById('Text').setAttribute('class','red1');
// You can define your stop music statements here } }
.red {
background: red;
height: 30px;
width: 30px;
border-radius: 50px;
border: 1px solid #000;}
.green {
background: green;
height: 30px;
width: 30px;
border-radius: 50px;
border: 1px solid #000;}
Skip <button id="Skip" class="red" onclick="controls(this.getAttribute('class'))">Play</button>
Text <button id="Text" class="red1" onclick="controls(this.getAttribute('class'))">Play</button>