tagged [dom]

How do I check if an element is hidden in jQuery?

How do I check if an element is hidden in jQuery? How do I toggle the visibility of an element using `.hide()`, `.show()`, or `.toggle()`? How do I test if an element is `visible` or `hidden`?

5 Jul at 07:29

Find an element in DOM based on an attribute value

Find an element in DOM based on an attribute value Can you please tell me if there is any DOM API which search for an element with given attribute name and attribute value: Something like:

30 Sep at 17:37

What is the difference between children and childNodes in JavaScript?

What is the difference between children and childNodes in JavaScript? I have found myself using JavaScript and I ran across `childNodes` and `children` properties. I am wondering what the difference b...

28 Oct at 22:55

Detect changes in the DOM

Detect changes in the DOM I want to execute a function when some div or input are added to the html. Is this possible? For example, a text input is added, then the function should be called.

DOM element to corresponding vue.js component

DOM element to corresponding vue.js component How can I find the vue.js component corresponding to a DOM element? If I have Is there a vue method equivalent to the jQuery

2 Feb at 06:55

How to replace DOM element in place using Javascript?

How to replace DOM element in place using Javascript? I am looking to replace an element in the DOM. For example, there is an `` element that I want to replace with a `` instead. How would I go and do...

15 Jun at 09:39

How to dynamic filter options of <select > with jQuery?

How to dynamic filter options of with jQuery? So that when user inputs something, only options with value matching the input will show.

20 Dec at 20:14

Can multiple different HTML elements have the same ID if they're different elements?

Can multiple different HTML elements have the same ID if they're different elements? Can multiple HTML elements have the same ID if they're of different element types? Is a scenario like this valid? E...

28 Aug at 12:21

How can I tell if a DOM element is visible in the current viewport?

How can I tell if a DOM element is visible in the current viewport? Is there an efficient way to tell if a DOM element (in an HTML document) is currently visible (appears in the )? (The question refer...

15 Dec at 04:44

How to check whether a Button is clicked by using JavaScript

How to check whether a Button is clicked by using JavaScript Is there a simple way to do something along these lines: JavaScript: HTML:

5 Sep at 19:44

How to append text to a div element?

How to append text to a div element? I’m using AJAX to append data to a `` element, where I fill the `` from JavaScript. How can I append new data to the `` without losing the previous data found in i...

20 Jan at 21:7

Capture the close event of popup window in JavaScript

Capture the close event of popup window in JavaScript I need to perform some action before a popup window(using `window.open` ) closes. Something like will be good: How can I achieve that?

23 Aug at 14:44

Javascript onHover event

Javascript onHover event Is there a canonical way to set up a JS `onHover` event with the existing `onmouseover`, `onmouseout` and some kind of timers? Or just any method to fire an arbitrary function...

28 Jan at 21:50

How can I remove all CSS classes using jQuery/JavaScript?

How can I remove all CSS classes using jQuery/JavaScript? Instead of individually calling `$("#item").removeClass()` for every single class an element might have, is there a single function which can ...

7 Aug at 21:36

How to get the HTML for a DOM element in javascript

How to get the HTML for a DOM element in javascript Imagine I have the following HTML: I want to get the HTML for the div, including the div itself. Element.innerHTML only returns: Any ideas? Thanks

1 Feb at 16:26

Remove element by id

Remove element by id When removing an element with standard JavaScript, you must go to its parent first: Having to go to the parent node first seems a bit odd to me, is there a reason JavaScript works...

12 Jun at 10:5

How can I loop through ALL DOM elements on a page?

How can I loop through ALL DOM elements on a page? I'm trying to loop over ALL elements on a page, so I want to check every element that exists on this page for a special class. So, how do I say that ...

10 Feb at 14:27

Difference between DOM parentNode and parentElement

Difference between DOM parentNode and parentElement Can somebody explain in simple terms, what is the difference between classical DOM [parentNode](https://developer.mozilla.org/en-US/docs/Web/API/Nod...

12 Nov at 10:23

JavaScript: SyntaxError: missing ) after argument list

JavaScript: SyntaxError: missing ) after argument list I am getting the error: > SyntaxError: missing ) after argument list With this javascript: ``` var nav = document.getElementsByClassName('nav-col...

24 May at 11:47

Is there a way to get/save the DOM with Selenium?

Is there a way to get/save the DOM with Selenium? What I'm looking for is a method that works like "captureScreenshot(String path)", but instead of producing an image is saves the DOM as it currently ...

9 Sep at 13:16

jQuery count child elements

jQuery count child elements I want to count the total number of `` elements in ``. How is that possible using jQuery's `.children([selector])`?

25 Apr at 10:35

Call a Javascript function every 5 seconds continuously

Call a Javascript function every 5 seconds continuously > [Calling a function every 60 seconds](https://stackoverflow.com/questions/3138756/jquery-repeat-function-every-60-seconds) I want to Call a J...

31 Mar at 07:39

How to pass arguments to addEventListener listener function?

How to pass arguments to addEventListener listener function? The situation is somewhat like- The problem is that the value of `someVar` is not visible inside the listener function of the `addEventList...

30 Jan at 12:37

What are passive event listeners?

What are passive event listeners? While working around to boost performance for progressive web apps, I came across a new feature `Passive Event Listeners` and I find it hard to understand the concept...

How to get element by class name?

How to get element by class name? Using JavaScript, we can get element by id using following syntax: I tried following to get element by class: But it resulted into error: How can I get an element by ...

31 Jul at 09:4