Suppose there is a page, but the width in javascript is given only to the first. How to make the style ask all the element at once with some Id?
<html> <head> <link rel="stylesheet" type="text/css" href="css/style.css"> <script type="text/javascript"> function Div() { var W = window.innerWidth - 200; var H = window.innerHeight - 50; var WMess = window.innerWidth - 280; document.getElementById('mess').style.width = WMess + "px"; } </script> </head> <body onLoad="Div()"> <div> <div id='mess'>Далинин Станислав</div> </div> <div> <div id='mess'>Далинин Станислав</div> </div> </body> </html>