다음 코드가 있습니다.
<script type="text/javascript">
var screenWidth = window.screen.width;
var width_sides = (screenWidth - 980) / 2;
</script>
<div id="not_important" width=""></div>
javascript 태그 내부의 방정식 결과와 동일한 div의 너비를 설정하고 싶습니다. 어떻게 할 수 있습니까?
감사
<div id="not_important" width=""></div>
<script type="text/javascript">
var screenWidth = window.screen.width;
var width_sides = (screenWidth - 980) / 2;
document.getElementById('not_important').style.width = width_sides;
</script>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다