Skip to content

Dom.RequestFullscreen

boxgaming edited this page Jul 13, 2026 · 1 revision

Requests the browser to display a specified element in fullscreen mode.
Available in release 0.11.0

Syntax

Dom.RequestFullscreen element

Parameters

  • The element parameter specifies the HTML element to display in fullscreen mode.

Example

Import Dom From "lib/web/dom.bas"

Dim Shared As Object panel, textbox, img

panel = Dom.Create("div")
panel.style.padding = "20px"
panel.style.border = "1px solid #666"
panel.style.backgroundColor = "#333"
textbox = Dom.Create("textarea", panel)
textbox.style.width = "300px"
textbox.style.height = "40px"
btn = Dom.Create("button", panel, "Test Button")
btn.style.verticalAlign = "top"

Print "Press any key to make the container fullscreen..."
Sleep
Dom.RequestFullscreen Dom.Container
Sleep 1
Print
Print "Press any key to make the panel div fullscreen..."
Sleep
Dom.RequestFullscreen panel
textbox.value = "Press any key to make the textbox fullscreen..."
Sleep 1
Sleep
Dom.RequestFullscreen textbox
textbox.style.fontSize = "32px"
textbox.value = "The textbox is now fullscreen.  Press ESC to exit"

See Also

_FULLSCREEN
JavaScript Element: requestFullscreen()

Clone this wiki locally