Name

HTMLElement.scrollIntoView( ) — make an element visible

Availability

Internet Explorer 4

Synopsis

                  element.scrollIntoView(top)

Arguments

top

An optional boolean argument that specifies whether the element should be scrolled to the top or bottom of the screen. If true or omitted, element appears at the top of the screen. If false, element appears at the bottom of the screen.

Description

scrollIntoView( ) scrolls the document containing element so the top of element is aligned with the top of the display area or the bottom of element is aligned with the bottom of the display area.

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.