I made input buttons, and for some reason they are not triggering my functions ... can some one shine a light on this?
<div id="windowBar">
<h3>If you were Chuck Norris...</h3>
<input id="WindowClose" type="button" onclick="close();"></input>
<input id="windowSmall" type="button" onclick="min();"></input>
</div>
and my jQuery:
function close() {
$("#inputWindow").hide(300);
}
function min() {
if (minimize === false) {
$("#inputWindow").hide();
$('#windowBar2').css('display','block');
$('#windowBar2 h3').css('display','block');
minimize = true;
} else {
$("#inputWindow").show();
$('#windowBar2').css('display','none');
$('#windowBar2 h3').css('display','none');
minimize = false;
}
}
document.readyonclick. So, both functions and the DOM element are defined in DOM tree wen executing the code. If he puts the functions indocument.ready, then they won't be defined in the global scope. The best practice is to define functions out of$()scope.minimizecome from?