Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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>
Advertisement
Add Comment
Please, Sign In to add comment