Code Snippet Example for Live Writer

September 20th, 2008 § 0 comments

   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.

 

Tagged

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

meta