blob: e30535dd91850e38d64be2c82f348a722af78f2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<!DOCTYPE html>
<html>
<body>
<div id="source" style="width: 3ch"></div>
<div id="target" style="width: 0">
This is a test
</div>
<script>
document.getElementById("target").style.lineHeight =
document.defaultView
.getComputedStyle(document.getElementById("source")).width;
</script>
</body>
</html>
|