I found the book "JavaScript & jQuery - The Missing Manual" to be a concise, well-written intro to JavaScript (link below gives a bit more insight). It also covers jQuery, an excellent JavaScript library. Even if You are not interested in jQuery, just the JavaScript (only) parts and chapters discussing JavaScript strategies are worth the book price.
Basic question - tying things together - #5 by JimScott
One idea for indicating a muted button - using a thicker border for the button that is muted:
The script for the function "muteSoundToggle" from my previous example with indicated code changes:
whatEl = element.id; // new code
whatEl = hypeDocument.getElementById(whatEl); // new code
whatSnd = element.id.slice(-7);
muteSnd = document.getElementById(whatSnd);
//muteSnd.muted ? muteSnd.muted = false : muteSnd.muted = true;
// previous code, no longer used to be replaced by segment below
if(muteSnd.muted == false) {
muteSnd.muted = true;
whatEl.style.borderWidth = "3px";
} else if(muteSnd.muted == true) {
muteSnd.muted = false;
whatEl.style.borderWidth = "1px";
}