The form widgets in Dijit are special. For all ordinary widgets, the Dijit domNode (external node) of the widget receives the id property. However, with widgets of the form focusNode (which corresponds to the <input> element) gets an identifier instead, so things like <label for="foo"> work correctly. In this case, the external node does not have an identifier, and you are actually just hiding the internal HTML input element.
If you already have a link to the widget:
require([ 'dojo/dom-style' ], function (domStyle) { domStyle.set(widget.domNode, 'display', 'none'); });
If you only have a link to the widget / original id of the DOM node:
require([ 'dojo/dom-style', 'dijit/registry' ], function (domStyle, registry) { domStyle.set(registry.byId(nodeId).domNode, 'display', 'none'); });
source share