---
title: "Discussion on \"Find if an element is completely visible in the viewport\" | Hashnode"
description: "Discussion on \"Find if an element is completely visible in the viewport\". Here is the JS code to find out if a given element on the DOM is completely visible in the browser window viewport or not:\nfunction isInViewport(element) {\n  var rect = element.getBoundingClientRect();\n  var html = document.documentElement;\n  if (\n  ..."
url: "https://hashnode.com/posts/find-if-an-element-is-completely-visible-in-the-viewport-3149dc578b15/6125c5cb663d427e19ffb763"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Find if an element is completely visible in the viewport](https://blog.adarshkonchady.com/find-if-an-element-is-completely-visible-in-the-viewport-3149dc578b15?utm_source=hashnode&utm_medium=feed)

Here is the JS code to find out if a given element on the DOM is completely visible in the browser window viewport or not: function isInViewport(element) { var rect = element.getBoundingClientRect(); var html = document.documentElement; if ( ...

May 18, 2016 · 1 min read · blog.adarshkonchady.com  
Updated Jul 9, 2023  
Read the article

## Written by

[Adarsh Konchady](https://hashnode.com/@adarshkonchady)

@adarshkonchady · Minnesota, US

  
[View profile](https://hashnode.com/@adarshkonchady)

Interested in all things Web !

As a Senior Principal Engineer at CVSHealth, I specialize in building and optimizing cvs.com to deliver a superior guest experience. Using the latest web technologies, my team and I work diligently to create a user-friendly and intuitive platform that exceeds expectations.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
