ive was trying to figure out why my JavaScript code was not working. The warning works fine, but when I try to write in a div, it does nothing. What am I doing wrong? I tried to answer Google, but it is not too useful.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="gamejavascript.js" type="text/javascript"> </script>
<link rel="stylesheet" type="text/css" href="gameStyle.css">
<title>Text Adventure RPG</title>
</head>
<body>
<p>hey </p>
<div id="eventWindow">
<div id="title">Black Forest</div>
<div id="eventContent">You have entered the black forest. Lucky you!</div>
</div>
<div id="itemList">Hey hey hey </div>
<div id="userStat"> </div>
</body>
</html>
My javascript
$("p").append("HEY HEYH YEYEHE.");
alert("You madam are a horse!");
$("#userStat").html("Hey baby");
Thank you so much for your help!
-Brent
source
share