Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/support
esri/workers
Object: esri/domUtils

require(["esri/domUtils"], function(domUtils) { /* code goes here */ });

Description

(Added at v3.8)
Utility methods related to working with the DOM.

When coding legacy (non-AMD) style, there is no need to require the module. All methods and properties are available in the namespace. For example, esri.show().

Samples

Search for samples that use this class.

Properties

NameTypeSummary
documentBoxObjectRepresents the size of the client side window or document at first load.

Methods

NameReturn typeSummary
getNode(target)NodeReturns the DOM node from HTMLElement or dijit/_WidgetBase.
hide(target)NoneHides the HTMLElement or dijit/_WidgetBase.
show(target)NoneShows the HTMLElement or dijit/_WidgetBase.
toggle(target)NoneIf the target (HTMLElement or dijit/_WidgetBase) is currently visible, the target is hidden.
Property Details

<Object> documentBox

Represents the size of the client side window or document at first load. The size contains w (width) and h (height) properties, and these do not change on window resize.
Method Details

getNode(target)

Returns the DOM node from HTMLElement or dijit/_WidgetBase. (Added at v3.13)
Return type: Node
Parameters:
<HTMLElement | _WidgetBase> target Required The HTMLElement or dijit/_WidgetBase to retrieve.
Sample:
require([
  "esri/domUtils", ... 
], function(domUtils, ... ) {
  var node = domUtils.getNode(myHTMLElement);
  ...
});

hide(target)

Parameters:
<HTMLElement | _WidgetBase> target Required The HTMLElement or dijit/_WidgetBase.
Sample:
require([
  "esri/domUtils", ... 
], function(domUtils, ... ) {
  domUtils.hide(myTable);
  // or
  domUtils.hide(widget);
  ...
});

show(target)

Parameters:
<HTMLElement | _WidgetBase> target Required The HTMLElement or dijit/_WidgetBase.
Sample:
require([
  "esri/domUtils", ... 
], function(domUtils, ... ) {
  domUtils.show(myDiv);
  // or
  domUtils.show(widget);
  ...
});

toggle(target)

If the target (HTMLElement or dijit/_WidgetBase) is currently visible, the target is hidden. If the target is hidden, it becomes visible.
Parameters:
<HTMLElement | _WidgetBase> target Required The HTMLElement or dijit/_WidgetBase.
Sample:
require([
  "esri/domUtils", ... 
], function(domUtils, ... ) {
  domUtils.toggle(myDiv);
  ...
});
Show Modal