Javascript examples for DOM:Element clientWidth
Get element calculated client width
<html lang="en"> <head> <title>min-max-with-calc</title> <style> div {/*from w w w . j a v a 2 s .c o m*/ border: 2px solid blue; width: calc(6e18px + 100vw - 6e18px); } </style> </head> <body translate="no"> <div></div> <script> window.onresize = foo; function foo() { let d = document.getElementsByTagName('div')[0]; d.innerHTML = 'width is '+d.clientWidth+' px'; } foo(); </script> </body> </html>