Saturday, 31 August 2013

This jQuery code won't work. Beginner Here.

This jQuery code won't work. Beginner Here.

Just started practicing with jQuery, but I can't seem to get any of the
functions to work. This code below is an exercise I've been trying to run,
but it won't output the desired result. Does anyone know why? Thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www/w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type"
content="text/xml; charset=utf-8" />
<title>change2.html</title>
<script type = "text/javascript"
src = "jquery-1.4.2.min.js">
</script>
<script type = "text/javascript">
//<![CDATA[
$(document).ready(changeMe);
function changeMe(){
$("#output").html("I've changed");
}
//]]>
</script>
</head>
<body>
<h1>Using the document.ready mechanism</h1>
<div id = "output">
Did this change?
</div>
</body>
</html>

No comments:

Post a Comment