pineappelle
02-02-2012, 05:28 AM
why arent both buttons changing and why isnt the color of the text changing
<html>
<head>
<title>Testing</title>
<style type="text/css">
#submit {
width: 200px;
height: 75px;
background-color: black;
color: gray;
text-align: center;
line-height: 75px;
font-size: 50px;
border: 5px solid red;
position: absolute;
}
#submit:hover {
background-color: gray;
color: black;
border: 5px solid yellow;
text-decoration: underline;
cursor: pointer;
}
body {
background-color: black;
}
#picture {
visibility: hidden;
position: absolute;
top: 150px;
}
a:left
</style>
<script type="text/javascript">
function show() {
document.getElementById('body').style.backgroundImage = 'url(http://www.boallen.com/assets/images/randbitmap_true.png)';
document.getElementById('submit').style.backgroundImage = 'url(http://www.ysb.on.ca/uploads/images/feature%20stories,%20other%20web
%20text/Rainbow_Ocean__by_Thelma1.jpg)';
document.getElementbyId('submit').style.color = 'black';
}
function hide() {
document.getElementById('body').style.backgroundImage = 'none';
document.getElementById('submit').style.backgroundImage = 'none';
}
</script>
</head>
<body id="body">
<div id="submit" onClick="show();">
Change
</div>
<div id="submit" onClick="hide();" style="left: 250px;">
Original
</div>
<br>
<br>
<br>
<div id="picture">
<img src="http://www.boallen.com/assets/images/randbitmap_true.png">
</div>
</body>
</html>
<html>
<head>
<title>Testing</title>
<style type="text/css">
#submit {
width: 200px;
height: 75px;
background-color: black;
color: gray;
text-align: center;
line-height: 75px;
font-size: 50px;
border: 5px solid red;
position: absolute;
}
#submit:hover {
background-color: gray;
color: black;
border: 5px solid yellow;
text-decoration: underline;
cursor: pointer;
}
body {
background-color: black;
}
#picture {
visibility: hidden;
position: absolute;
top: 150px;
}
a:left
</style>
<script type="text/javascript">
function show() {
document.getElementById('body').style.backgroundImage = 'url(http://www.boallen.com/assets/images/randbitmap_true.png)';
document.getElementById('submit').style.backgroundImage = 'url(http://www.ysb.on.ca/uploads/images/feature%20stories,%20other%20web
%20text/Rainbow_Ocean__by_Thelma1.jpg)';
document.getElementbyId('submit').style.color = 'black';
}
function hide() {
document.getElementById('body').style.backgroundImage = 'none';
document.getElementById('submit').style.backgroundImage = 'none';
}
</script>
</head>
<body id="body">
<div id="submit" onClick="show();">
Change
</div>
<div id="submit" onClick="hide();" style="left: 250px;">
Original
</div>
<br>
<br>
<br>
<div id="picture">
<img src="http://www.boallen.com/assets/images/randbitmap_true.png">
</div>
</body>
</html>