What is availWidth property in JavaScript?


Use the screen.availWidth property to return the width of the user’s screen. The result will be in pixels and the Taskbar feature won’t be included.

Example

You can try to run the following code to learn how to work with the screen.availWidth property in JavaScript −

Live Demo

<!DOCTYPE html>
<html>
   <body>
      <script>
         document.write("Width of the user’s screen: "+screen.availWidth);
      </script>
   </body>
</html>

Sharon Christine
Sharon Christine

An investment in knowledge pays the best interest

Updated on: 23-Jun-2020

57 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements