I followed as in this example link
But on the page my result was:
In this same example ( link ) already has the answer
$(window).resize(function() { var viewportWidth = $(window).width(); $('#monitor').html(viewportWidth);
});