Questions tagged [dom-node]
84 questions
42
votes
2 answers
How to get html code of DOMElement node?
I have this html code:
...
I already can get the "foo" element (but only its content) with this…
SOMECONTENTWITHMORETAGS

Xaver
- 11,144
- 13
- 56
- 91
20
votes
3 answers
Check if variable is a valid node element
How can I change a JS element to see if it is a node or an empty variable?

Ben
- 60,438
- 111
- 314
- 488
10
votes
1 answer
Typescript: The type of TextNode
If you write below code:
const e = document.body.firstChild;
if (e.nodeType === Node.TEXT_NODE)
console.log(e.data);
You will get this error on e.data:
TS2339: Property 'data' does not exist on type 'ChildNode'.
While if the condition be true…

Mir-Ismaili
- 13,974
- 8
- 82
- 100
7
votes
1 answer
Invariant Violation: Argument appears to not be a ReactComponent
I need to find the offsetLeft of a component.
componentDidMount(){
var tesNo =ReactDOM.findDOMNode(this.refs.dropDown.refs.input.offsetLeft)
}
While debugging I get the value of…

Jane Fred
- 1,379
- 7
- 23
- 47
7
votes
1 answer
how to add a xml node to a symfony Crawler()
I need to manage xml documents in saymfony.
I've got no problem to get the xml into a Crawler() instance, modify existing node and after it, put the xml into a file.
But i can't add new node.
When i try to add a new node with appendChild method to…

Jul6art
- 219
- 3
- 14
6
votes
2 answers
When is "DOMNodeInserted" event called?
DOMNodeInserted event is called when the node "be appended to", or "be appended"?
I ask this because the following code:
function AddTextToContainer () {
var textNode = document.createTextNode ("My text");
var container =…

Lai Yu-Hsuan
- 27,509
- 28
- 97
- 164
5
votes
3 answers
Modifying element from google.translate.TranslateElement results
I'm attempting to embed the very convenient Google Translate translate element into a webpage, which is super simple and works great, but I need to change the default text that displays in the resulting HTML:
Having worked with a number of Google…

Ben D
- 14,321
- 3
- 45
- 59
5
votes
2 answers
how to use document.getElementById() in Nodejs
i'm trying to get elements by id from an html file in a js file using nodejs.
I'm getting the error 'document id not defined' because node doesn't provide a document object model by default.
So how can i use document.getElementById() in nodejs…

Sarah ßezi
- 99
- 1
- 2
- 6
5
votes
1 answer
What is the "text" child node of the html node?
I have tried to search but have not found an answer to this:
So I know that when a page is passed to or downloaded by a browser a tree structure representation of the page, called the DOM, is generated. Javascript can then be used to manipulate the…

Zuks
- 1,247
- 13
- 20
4
votes
3 answers
PL/SQL Raw datatype variable comparison
Is it possible to compare variables of raw datatypes?
I'm working with XMLDOM.DomNodes, which is records with one field by itself:
TYPE DOMNode IS RECORD (id RAW(12));
So I have two nodes, then could I compare them by their id fields? I tried…

Andrey Khataev
- 1,303
- 6
- 20
- 46
4
votes
1 answer
Trigger Animation by scrolling to a predefined Component/Node
I would like to be able to "bind" the useScrollTrigger hook to a specific Component/Node rather than the window default value.
The following shows the useScrollTrigger expected parameters:
export interface UseScrollTriggerOptions {
…

ares
- 41
- 1
4
votes
0 answers
Comparing different DOM nodes which ones are more performant?
Trying to reduce the amount of DOM nodes I did some research on this, but have not found any comparing numbers, like is it better to use two DOM elements instead of two pseudo-elements or is it better to use 20-characters text-nodes instead of…

extempl
- 2,987
- 1
- 26
- 38
4
votes
1 answer
Get the height of a Component in React
I have 4 columns, none of whose height is fixed, and I need to find the height of these columns so that the height of the largest column can be set to the other three. How can I do this with React and not using the 'minHeight' css?
I am a newbie in…

Kshitij Bajracharya
- 811
- 2
- 14
- 37
4
votes
1 answer
Equivalent of DOMNodeInserted DOMNodeRemoved with MutationObserver?
I currently have the code:
$('.example').bind('DOMNodeInserted DOMNodeRemoved', function(event) {
....
});
Which works perfectly but it is not very efficient and has since deprecated. What is a better way to do this?
I have been looking into…

maxisme
- 3,974
- 9
- 47
- 97