Guest User

Untitled

a guest
Aug 10th, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Multiple javascript buttons (Enable/Disable)
  2. // Left Menu function controls(className) {
  3. if (className == "red") {
  4. document.getElementById('Skip').setAttribute('class','green');
  5. // You can define your play music statements here
  6. } else {
  7. document.getElementById('Skip').setAttribute('class','red');
  8. // You can define your stop music statements here
  9. } }
  10.  
  11. if (className == "red1") {
  12. document.getElementById('Text').setAttribute('class','green1');
  13. // You can define your play music statements here } else {
  14. document.getElementById('Text').setAttribute('class','red1');
  15. // You can define your stop music statements here } }
  16.  
  17. .red {
  18. background: red;
  19. height: 30px;
  20. width: 30px;
  21. border-radius: 50px;
  22. border: 1px solid #000;}
  23.  
  24. .green {
  25. background: green;
  26. height: 30px;
  27. width: 30px;
  28. border-radius: 50px;
  29. border: 1px solid #000;}
  30.  
  31. Skip &nbsp; <button id="Skip" class="red" onclick="controls(this.getAttribute('class'))">Play</button>
  32.  
  33. Text &nbsp; <button id="Text" class="red1" onclick="controls(this.getAttribute('class'))">Play</button>
Advertisement
Add Comment
Please, Sign In to add comment