Code Snippet Example for Live Writer

In: Online

20 Sep 2008
   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.

Comment Form

About this blog

Jason Burns is a technology enthusiast, Microsoft guy, photographer, musician and all around geek. This blog is the general rambling one, check out the links for the specific ones!

Photostream

    Dean VMNT SignatureESP VB.C. Rich VJackson King VMean Water HoseMean Water HoseMean Water HoseNew House - Lived in a littleNew House - Lived in a little
Jason Burns

Create Your Badge