So basically if you get what I am doing, I want it to be such that when I click the next button the color of one goes to three and three goes to two and two goes to one. I have been trying to make it fetch the color of two but without success
<!DOCTYPE html>
<html>
<Head>
<style>
div {
height: 50px;
}
#one {
width: 100%;
background-color: #f00;
}
#two {
width: 50%;
background-color: #0f0;
float: left;
}
#three {
width: 50%;
background-color: #00f;
float: right;
}
</style>
<script>
function oneToTwo() {
document.getElementById("one").style.backgroundColor = document.getElementById("two").style.backgroundColor;
}
</script>
</Head>
<body>
<div id="one"></div>
<div id="two"></div>
<div id="three"></div>
<input type="button" value="Back" title="The back button">
<input type="button" value="Next" title="The next button" onclick="oneToTwo()">
</body>
</html>