Use the screen.availHeight property to return the width of the user’s screen. The result will be in pixels and Taskbar feature won’t be included.
Example
You can try to run the following code to learn how to work with the screen.availHeight property in JavaScript −
<!DOCTYPE html> <html> <body> <script> document.write("Height of the screen: "+screen.availHeight); </script> </body> </html>