I'm trying to change browser width and height into .test div. whenever I re-size the browser the current value should change.
$(document).ready( function() { window.onresize = function(event) { resizeDiv(); } function resizeDiv() { var vpw=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var vph=window.innerHeight || document.documentElement.clientHeight ||document.body.clientHeight; $(‘.test’).css({‘height': vph + ‘px’}); } ); .test { background: green; padding: 20px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div class="test"></div>
$(‘.test’).height(vph);