Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (63 sloc) 1.27 KB
<html>
<!--
Lecture 6 - CSC 210 Fall 2015
Philip Guo
-->
<head>
<title>
My first webpage
</title>
<style type="text/css">
/* these are CSS comments */
h1 {
font-size: 100px;
font-family: arial;
}
img {
width: 300px;
}
p#myLine {
color: red;
}
</style>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
function doMoreInitializing() {
console.log("more!");
}
function changeToBear() {
$("#mainImage").attr("src", "bear.jpg");
console.log('rawr!');
}
$(document).ready(function() {
console.log("Hello world!");
doMoreInitializing();
$("#catButton").click(function() {
$("#mainImage").attr("src", "cat.jpg");
console.log('meow!');
});
$("#dogButton").click(function() {
$("#mainImage").attr("src", "dog.jpg");
console.log('bark!');
});
$("#bearButton").click(changeToBear);
});
</script>
</head>
<body>
<h1>My heading</h1>
<h2>
My sub-heading
</h2>
<img id="mainImage" src="truck.jpg"/>
<p>Hello</p>
<h2>
My other sub-heading
</h2>
<p id="myLine">a new line</p>
<p>another one</p>
<button id="catButton">Cat</button>
<button id="dogButton">Dog</button>
<button id="bearButton">Bear</button>
</body>
</html>