Ik heb onderstaande code voor mijn website. Nu zit ik alleen met een vraag, namelijk:
Hoe kan ik ervoor zorgen dat de container een kleur rollover krijgt ?
Alvast bedankt !!
http://www.plaatscode.be/3682/
798 views
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function init () {
var c = document.getElementById ('container');
c.onmouseover = function () {
return handle_mouseover (this);
}
c.onmouseout = function () {
return handle_mouseout (this);
}
}
function handle_mouseover (obj) {
obj.style.backgroundColor = '#f00';
}
function handle_mouseout (obj) {
obj.style.backgroundColor = '#0f0';
}
// koppel de functie init aan het onload event van het window object
window.onload = init;
</script>
<style type="text/css">
#container {
background: #0f0;
}
</style>
</head>
<body>
<div id="container">
<h1>Koptekst</h1>
<p>Alineatekst, Alineatekst, Alineatekst, Alineatekst, Alineatekst</p>
</div>
</body>
</html>