GlideDocument - Client
concept brazil Updated Sep 10, 2026 1 min read c_GlideDocumentV3API.md
The GlideDocument API provides methods to search a Document Object Model (DOM) element, a document, or a JQuery element.
You can use this API in client-side scripts using ListV2 and ListV3 APIs. The GlideDocument APIs are accessed using the g_document global object.
Parent Topic:Client API reference
GlideDocument - getElement(String selector, Element context)
Returns a node found in the specified DOM based context or created from the HTML context.
| Name | Type | Description |
|---|---|---|
| selector | String or Object | Selector expression |
| context | String or Object | Optional. DOM Element, document, or JQuery object to search. |
| Type | Description |
|---|---|
| node | Node that matches the selector. |
This example shows how to get the list view name value from a UI page.
JavaScript
//HTML entry<input type="hidden" id="list_view" name="list_view" value="${sysparm_list_view}" />
// Client scriptvar listView = g_document.getElement('#list_view').value;GlideDocument - getElements(String selector, Element context)
Returns a node list found in the specified DOM based context or created if an HTML context is specified.
| Name | Type | Description |
|---|---|---|
| selector | String or Object | The selector expression |
| context | String or Object | (Optional) A DOM Element, document, or JQuery object to be searched. |
| Type | Description |
|---|---|
| node list | A list of nodes that matches the selector. |
59 lines · 2.2 KB
---
title: GlideDocument - Client
description: The GlideDocument API provides methods to search a Document Object Model \(DOM\) element, a document, or a JQuery element.Returns a node found in the specified DOM based context or created from the HTML context.Returns a node list found in the specified DOM based context or created if an HTML context is specified.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/api-reference/c\_GlideDocumentV3API.html
release: brazil
product: API Reference
classification: api-reference
topic_type: concept
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Client API reference, API reference, API implementation and reference]
---
# GlideDocument- Client
The GlideDocument API provides methods to search a Document Object Model \(DOM\) element, a document, or a JQuery element.
You can use this API in client-side scripts using ListV2 and ListV3 APIs. The GlideDocument APIs are accessed using the `g_document` global object.
**Parent Topic:**[Client API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/brazil/markdown/api-reference/api-client.md)
## GlideDocument - getElement\(String selector, Element context\)
Returns a node found in the specified DOM based context or created from the HTML context.
|Name|Type|Description|
|----|----|-----------|
|selector|String or Object|Selector expression|
|context|String or Object|Optional. DOM Element, document, or JQuery object to search.|
|Type|Description|
|----|-----------|
|node|Node that matches the selector.|
This example shows how to get the list view name value from a UI page.
```
//HTML entry
<input type="hidden" id="list_view" name="list_view" value="${sysparm_list_view}" />
// Client script
var listView = g_document.getElement('#list_view').value;
```
## GlideDocument - getElements\(String selector, Element context\)
Returns a node list found in the specified DOM based context or created if an HTML context is specified.
|Name|Type|Description|
|----|----|-----------|
|selector|String or Object|The selector expression|
|context|String or Object|\(Optional\) A DOM Element, document, or JQuery object to be searched.|
|Type|Description|
|----|-----------|
|node list|A list of nodes that matches the selector.|
| title | GlideDocument - Client |
| description | The GlideDocument API provides methods to search a Document Object Model \(DOM\) element, a document, or a JQuery element.Returns a node found in the specified DOM based context or created from the HTML context.Returns a node list found in the specified DOM based context or created if an HTML context is specified. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/api-reference/c\_GlideDocumentV3API.html |
| release | brazil |
| product | API Reference |
| classification | api-reference |
| topic_type | concept |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Client API referenceAPI referenceAPI implementation and reference |