enode.element
Property enode.element is the reference to the associated HTML element of the current enode.
It is mainly used to access the original HTML element and its native methods/properties.
warning
Should NOT assign new value for this property, or it will impact the built-in logic and the UI might not work as expected.
For example, avoid coding:
JavaScript
enode.element = 123;
enode.element = 'text';
enode.element = document.createElement('div');
This property should be considered as read-only, and used for accessing native Web APIs.
If you want to change the associated HTML element of the current enode, use enode.set().
Syntax
JavaScript
enode.element
Value
- Expect native HTML objects like Node, Element, and DocumentFragment.
Examples
JavaScript
var content = new Binh.ElementNode(document.createElement('div'));
var spanEl = document.createElement('span');
console.log(content.element); // Output: <div></div>
content.set(spanEl);
console.log(content.element); // Output: <span></span>