Skip to content

Tag: html

querySelectorAll is not a function

I’m trying to find all oferts in the var articleFirst, but the return message in the console says that “querySelectorAll” is not a function. Why I do get that error? This is my HTML: This is my JavaScript: Error: Uncaught TypeError: articleFirst.querySelectorAll is not a function Answer Try …

event.clipboardData.setData in copy event

I have looked at many posts but could not find a clear current answer to the following two questions as it seems standards and browser support has been constantly changing. Is it a legal operation according to the standard to change the clipboard with event.clipboardData.setData inside a ‘copy’ ev…

JavaScript get textContent excluding children

First, I’m creating a library for JavaScript and I can not use jQuery. I’m trying to get the text content of an HTML element without the text contents of its children. Both attributes innerText and textContent don’t give me what needed, please help. Answer You can solve using DOM API as chil…

Access iframe variable from parent – undefined

I want to access a variable in iframe from parent index.html. The index.html: The iframe index2.html: In the console, the variable clickParent is “undefined”. How to fix this and make the variable clickParent = clicks? This question is not a duplicate of Sharing global javascript variable of a pag…

Multiline tooltip doesn’t work programmatically

is supposed to separate lines on tooltip hover. This doesn’t work: But doing it in the html works: See an example of this here, just hover on the squares: https://jsfiddle.net/foreyez/3yg535jq/ Is there something I’m missing? Answer I run into this issue all the time. For some reason xml sp…