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.byId
indojo/dom
. dojo.isDescendant
Determines whether a node is a descendant of another. Alias of
dom.isDescendant
indojo/dom
.dojo.setSelectable
Enables or disables selection on a node. Alias of
dom.setSelectable
indojo/dom
.-
Gets an attribute on an HTML element. Alias of
domAttr.get
indojo/dom-attr
. -
Sets an attribute on an HTML element. Alias of
domAttr.set
indojo/dom-attr
. -
Returns true if the requested attribute is specified on the given element, false otherwise. Alias of
domAttr.has
indojo/dom-attr
. -
Removes an attribute from an HTML element. Alias of
domAttr.remove
indojo/dom-attr
. -
Returns an effective value of a property or an attribute. Alias of
domAttr.getNodeProp
indojo/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.contains
indojo/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.add
indojo/dom-class
. -
Removes the specified classes from node. No
dojo.hasClass
check is required. Alias ofdomClass.remove
indojo/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.toggle
indojo/dom-class
. -
Replaces one or more classes on a node if not present. Operates more quickly than calling
dojo.removeClass
anddojo.addClass
. Alias ofdomClass.replace
indojo/dom-class
. -
Instantiates an HTML fragment returning the corresponding DOM. Alias of
domConstruct.toDom
indojo/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.place
indojo/dom-construct
. -
Create an element, allowing for optional attribute decoration and placement. Alias of
domConstruct.create
indojo/dom-construct
. -
Safely removes all children of the node. Alias of
domConstruct.empty
indojo/dom-construct
. -
Removes a node from its parent, clobbering it and all of its children. Alias of
domConstruct.destroy
indojo/dom-construct
. dojo.getPadExtents
Returns object with special values specifically useful for node fitting. Alias of
domGeom.getPadExtents
indojo/dom-geometry
.dojo.getBorderExtents
Returns an object with properties useful for noting the border dimensions. Alias of
domGeom.getBorderExtents
indojo/dom-geometry
.dojo.getPadBorderExtents
Returns object with properties useful for box fitting with regards to padding. Alias of
domGeom.getPadBorderExtents
indojo/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.getMarginExtents
indojo/dom-geometry
.dojo.getMarginSize
Returns an object that encodes the width and height of the node’s margin box. Alias of
domGeom.getMarginSize
indojo/dom-geometry
.-
Returns an object that encodes the width, height, left and top positions of the node’s margin box. Alias of
domGeom.getMarginBox
indojo/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.setMarginBox
indojo/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.getContentBox
indojo/dom-geometry
. -
Sets the size of the node’s contents, irrespective of margins, padding, or borders. Alias of
domGeom.setContentSize
indojo/dom-geometry
. dojo.isBodyLtr
Returns true if the current language is left-to-right, and false otherwise. Alias of
domGeom.isBodyLtr
indojo/dom-geometry
.dojo.docScroll
Returns an object with {node, x, y} with corresponding offsets. Alias of
domGeom.docScroll
indojo/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.getIeDocumentElementOffset
indojo/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.fixIeBiDiScrollLeft
indojo/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.position
indojo/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.get
indojo/dom-prop
. -
Sets a property on an HTML element. Alias of
domProp.set
indojo/dom-prop
. -
Gets or sets a property on an HTML element.
-
Accesses styles on a node. Alias of
domStyle.get
indojo/dom-style
. -
Sets styles on a node. Alias of
domStyle.set
indojo/dom-style
. -
Returns a computed style object. Alias of
domStyle.getComputedStyle
indojo/dom-style
. dojo.toPixelValue
Converts style value to pixels on IE or return a numeric value. Alias of
domStyle.toPixelValue
indojo/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.