For some reason when I try and run a simple jQuery code it won't work. I beleive the code is correct and it's like my file isn't linked correctly. It also won't work on other pages with different code so I'm thinking it must be something with the way that jQuery is linked. My code is:
<!DOCTYPEhtml PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<script type="text/javascript" src="jquery-1.7.2.min"></script>
<script type="text/javascript">
$('#toggle_message').click(function() {
var value = $('#toggle_message').attr('value');
$('#message').toggle('fast');
if (value == 'Hide') {
$('#toggle_message').attr('value', 'Show');
} else if (value == 'Show') {
$('#toggle_message').attr('value', 'Hide');
}
}
});
$('#toggle_message').click();
</script>
</head>
<body>
<input type="button" value="Hide" id="toggle_message" />
<p id="message">This is a paragraph that will disappear</p>
</body>
</html>
Any help is appreciated. Also, my jQuery file is only 4 lines long.. Is that normal?