dojo/_base/html¶
| since: | V? | 
|---|
Contents
The dojo/_base/html module defines aliases to basic DOM & HTML handling functions for backwards-compatibility.  As with all dojo/_base components, these functions are included within Dojo Base, which you get simply by loading dojo.js  (except when loading baseless with async: true in Dojo 1.7+).
As of Dojo 1.7, the recommended practice going forward (with async: true) is to require just the individual dependencies you need, instead of dojo/_base/html.  The new locations of its functions are indicated in the list below.
Features¶
- 
Returns the DOM node with the matching ‘id. Alias of
dom.byIdindojo/dom. dojo.isDescendant
Determines whether a node is a descendant of another. Alias of
dom.isDescendantindojo/dom.dojo.setSelectable
Enables or disables selection on a node. Alias of
dom.setSelectableindojo/dom.- 
Gets an attribute on an HTML element. Alias of
domAttr.getindojo/dom-attr. - 
Sets an attribute on an HTML element. Alias of
domAttr.setindojo/dom-attr. - 
Returns true if the requested attribute is specified on the given element, false otherwise. Alias of
domAttr.hasindojo/dom-attr. - 
Removes an attribute from an HTML element. Alias of
domAttr.removeindojo/dom-attr. - 
Returns an effective value of a property or an attribute. Alias of
domAttr.getNodePropindojo/dom-attr. - 
Gets or sets an attribute on an HTML element.
 - 
Returns whether or not the specified classes are a portion of the class list currently applied to the node. Alias of
domClass.containsindojo/dom-class. - 
Adds the specified classes to the end of the class list on the passed node. Will not re-apply duplicate classes. Alias of
domClass.addindojo/dom-class. - 
Removes the specified classes from node. No
dojo.hasClasscheck is required. Alias ofdomClass.removeindojo/dom-class. - 
Adds a class to node if not present, or removes if present. Pass a boolean condition if you want to explicitly add or remove. Returns the condition that was specified directly or indirectly. Alias of
domClass.toggleindojo/dom-class. - 
Replaces one or more classes on a node if not present. Operates more quickly than calling
dojo.removeClassanddojo.addClass. Alias ofdomClass.replaceindojo/dom-class. - 
Instantiates an HTML fragment returning the corresponding DOM. Alias of
domConstruct.toDomindojo/dom-construct. - 
Attempt to insert node into the DOM, choosing from various positioning options. Returns the first argument resolved to a DOM node. Alias of
domConstruct.placeindojo/dom-construct. - 
Create an element, allowing for optional attribute decoration and placement. Alias of
domConstruct.createindojo/dom-construct. - 
Safely removes all children of the node. Alias of
domConstruct.emptyindojo/dom-construct. - 
Removes a node from its parent, clobbering it and all of its children. Alias of
domConstruct.destroyindojo/dom-construct. dojo.getPadExtents
Returns object with special values specifically useful for node fitting. Alias of
domGeom.getPadExtentsindojo/dom-geometry.dojo.getBorderExtents
Returns an object with properties useful for noting the border dimensions. Alias of
domGeom.getBorderExtentsindojo/dom-geometry.dojo.getPadBorderExtents
Returns object with properties useful for box fitting with regards to padding. Alias of
domGeom.getPadBorderExtentsindojo/dom-geometry.dojo.getMarginExtents
Returns object with properties useful for box fitting with regards to box margins (i.e., the outer-box). Alias of
domGeom.getMarginExtentsindojo/dom-geometry.dojo.getMarginSize
Returns an object that encodes the width and height of the node’s margin box. Alias of
domGeom.getMarginSizeindojo/dom-geometry.- 
Returns an object that encodes the width, height, left and top positions of the node’s margin box. Alias of
domGeom.getMarginBoxindojo/dom-geometry. - 
Set the size of the node’s margin box and placement (left/top), irrespective of box model. Think of it as a passthrough to setBox that handles box-model vagaries for you. Alias of
domGeom.setMarginBoxindojo/dom-geometry. - 
Returns an object that encodes the width, height, left and top positions of the node’s content box, irrespective of the current box model. Alias of
domGeom.getContentBoxindojo/dom-geometry. - 
Sets the size of the node’s contents, irrespective of margins, padding, or borders. Alias of
domGeom.setContentSizeindojo/dom-geometry. dojo.isBodyLtr
Returns true if the current language is left-to-right, and false otherwise. Alias of
domGeom.isBodyLtrindojo/dom-geometry.dojo.docScroll
Returns an object with {node, x, y} with corresponding offsets. Alias of
domGeom.docScrollindojo/dom-geometry.dojo.getIeDocumentElementOffset
Returns the offset in x and y from the document body to the visual edge of the page for IE. Alias of
domGeom.getIeDocumentElementOffsetindojo/dom-geometry.dojo.fixIeBiDiScrollLeft
In RTL direction, scrollLeft should be a negative value, but IE returns a positive one. All codes using documentElement.scrollLeft must call this function to fix this error, otherwise the position will offset to right when there is a horizontal scrollbar. Alias of
domGeom.fixIeBiDiScrollLeftindojo/dom-geometry.- 
Gets the position and size of the passed element relative to the viewport (if includeScroll==false), or relative to the document root (if includeScroll==true). Alias of
domGeom.positionindojo/dom-geometry. - 
Getter/setter for the margin-box of node.
 - 
Getter/setter for the content-box of node.
 - 
Deprecated: Use
position()for border-box x/y/w/h ormarginBox()for margin-box w/h/l/t. Returns an object representing a node’s size and position. - 
Gets a property on an HTML element. Alias of
domProp.getindojo/dom-prop. - 
Sets a property on an HTML element. Alias of
domProp.setindojo/dom-prop. - 
Gets or sets a property on an HTML element.
 - 
Accesses styles on a node. Alias of
domStyle.getindojo/dom-style. - 
Sets styles on a node. Alias of
domStyle.setindojo/dom-style. - 
Returns a computed style object. Alias of
domStyle.getComputedStyleindojo/dom-style. dojo.toPixelValue
Converts style value to pixels on IE or return a numeric value. Alias of
domStyle.toPixelValueindojo/dom-style.- 
Accesses styles on a node. If 2 arguments are passed, acts as a getter. If 3 arguments are passed, acts as a setter.