Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
document.getElementById("divId").style.height = "69px";
document.getElementById("div1Id").style.height = document.getElementById("div2Id").style.height;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript">
window.onload = function () {
document.getElementById("div2").style.height = "100px";
document.getElementById("div2").style.width = "100px";
}
function od() {
var d1 = document.getElementById("div1");
var d2 = document.getElementById("div2");
alert("div1 dimensions: " + d1.offsetWidth + " x " + d1.offsetHeight);
alert("div2 dimensions: " + d2.offsetWidth + " x " + d2.offsetHeight);
}
function sd() {
var d1 = document.getElementById("div1");
var d2 = document.getElementById("div2");
alert("div1 dimensions: " + d1.style.width + " x " + d1.style.height);
alert("div2 dimensions: " + d2.style.width + " x " + d2.style.height);
}
</script>
<style type="text/css">
div#div1 {
height:100px;
width:100px;
background-color:red;
margin-bottom:20px;
}
div#div2 {
background-color:blue;
margin-bottom:20px;
}
</style>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>
<input type="button" value="get dimensions with offset" onclick="od()" />
<input type="button" value="get dimensions with style" onclick="sd()" />
</body>
</html>
document.getElementById("someDiv").style.height = document.getElementById("someOtherDiv").offsetHeight [!]+ "px"[/!]