Jason Burns’ Blog

Icon

Thoughts from my warped little mind…

Code Snippet Example for Live Writer

   1: <script type="text/javascript">
   2:             
   3:             window.onload = function() {
   4:  
   5:                 //define message default
   6:                 document.getElementById('message').innerHTML = "(please press a button...)";
   7:  
   8:                 //setup events
   9:                 document.getElementById('btnStart').onclick = playIt;
  10:                 document.getElementById('btnStop').onclick = stopIt;
  11:  
  12:             }
  13:  
  14:             function playIt() {
  15:                 document.getElementById('message').innerHTML = "you pressed PLAY";
  16:                 document.getElementById('btnStart').style.backgroundColor = 'yellow';
  17:                 document.getElementById('btnStop').style.backgroundColor = '#ccc';
  18:             }
  19:  
  20:             function stopIt() {
  21:                 document.getElementById('message').innerHTML = "you pressed STOP";
  22:                 document.getElementById('btnStart').style.backgroundColor = '#ccc';
  23:                 document.getElementById('btnStop').style.backgroundColor = 'yellow';
  24:             }
  25:             
  26:  
  27:         </script>

Get the plugin here.

Category: Online

Tagged:

Leave a Reply

Countdown Timer

On Twitter...