There is a syntax error in the code:
Change
$(x).css("font-weight"), "bold");
to
$(x).css("font-weight", "bold");
Full function
function bold() { var x = $('#description-box'); if (x.css("font-weight") !== "bold") { x.css("font-weight", "bold"); } else { x.css("font-weight", "normal"); } }
Working script : http://jsfiddle.net/dZVfh/3/
There are a number of problems in your original violin.
jQuery did not turn on
The function was defined inside domReady - this means that it is not visible when the button is pressed
There was a syntax error in the CSS block. Style was closed with ) instead of }
You tried to assign the x element before the DOM was ready. The new fiddle does this inside the function (by then the DOM is ready)
source share