info343/labs/3/solution/pimpmytext.js

// pimpmytext.js
// Sample JavaScript solution for Lab 3: Pimp My Text
// INFO 343, Autumn 2012
// Morgan Doocy

// Increase the font size of the #sampletext textarea.
function bumpFontSize() {
   // // Exercise 3
   // alert("Hello world!");
   
   // Exercise 4
   document.getElementById("sampletext").style.fontSize = "24pt";
}

// Exercise 5
// Toggle "bling" (green color, blinking, underlined) on text in the
// #sampletext textarea.
function toggleBling() {
   var sampletext = document.getElementById('sampletext');
   if (document.getElementById("bling").checked) {
      sampletext.style.fontWeight = "bold";
      sampletext.style.textDecoration = "underline blink";
      sampletext.style.color = "green";
   } else {
      sampletext.style.fontWeight = "normal";
      sampletext.style.textDecoration = "none";
      sampletext.style.color = "black";
   }
}

// Exercise 6 (optional)
// Add '-izzle' to the end of each sentence inside #sampletext.
function snoopify() {
   var sampletext = document.getElementById('sampletext');
   sampletext.value = sampletext.value.toUpperCase();
   sampletext.value = sampletext.value.split(".").join("-izzle.");
}