Category "dom"

Why does jQuery or a DOM method such as getElementById not find the element?

What are the possible reasons for document.getElementById, $("#id") or any other DOM method / jQuery selector not finding the elements? Example problems include

Why don't my class styles apply to dynamically created elements? Angularjs

My question is simple; why don't my class styles apply to dynamically created elements? I am creating a search bar here where I generate an li per matching resu

jQuery .load() run the same as body displayed

i have a project that needs to include external html to my page. so this file will be included to many page. I'm using jQuery here. Let me show some code: $(doc

How to use document.getElementById() method in TypeScript?

I am trying to reset HTML Form in order to clear all the values in the input fields using; document.getElementById('myForm').reset(); But I can use that in

How to call different functions for different targets using an Intersection Observer?

I'm using the Intersection Observer API on a site. For every instance of using it, I'm using the same config (main viewport). My issue is that I need to have di

JQuery to prevent an element from getting focus?

How to prevent an input element (text, text area, select, radio button, checkbox) from getting focus? I basically want to make them disabled without changing di

Watch height of an element in VueJS

Is there any way to set a watcher on the height of an element in VueJS? I am trying to fix the filters part on a search result page. but if the results change

Is there a way to reorder "div" elements ,into a descending order, in the DOM according to their content with the onclick of a button?

I am trying to reorder the "divs" (pushed into the DOM via Javascript) with the onclick of a button. Specifically, I'm looking for a Javascript function to reac

How to open and close Ember Power Select from outside

I'm aware of this question, but is not complete. I want to open and close the dropdown from outside. I can dispatch a mousedown event when click on my wrapper

How to execute a Bash command using an Electron platform in Cordova

I'm trying to use Cordova that now includes Electron to create a Desktop App for Linux. I want a button that fires a shell command: const exec = require('chil

Iterate elements and toggle using classList in javascript

Conditions: Please use javascript and classList property to invert which elements have .highlight class. Basically iterate over all the <li> elements and

Observing DOM changes, Specifically input value change using Plain JavaScript [duplicate]

I have a certain requirement where I want to be notified about all changes in HTML input on a page specifically value of all input elements on

Extract color palette of a webpage [closed]

I intend to recolor a website with a new palette of colors. I plan to first extract the colors from the webpage and determine its color palett

how to make gpx file in android

I wanna write gpx file with DOM and Transformer My code is like that try { val document = DocumentBuilderFactory.newInstance().newDocumentBuilder().

I am trying to dynamically create a Mui icon using React.createElement. However, React lowercases the element. Is there a way to keep case?

I am getting service.icon from JSON, so it looks like so [ { "icon": "AdminPanelSettingsIcon", } ] I am using React.createElement() like so, data.map((

Draw d3-axis without direct DOM manipulation

Is there a way to use d3-axis without directly manipulating the DOM? D3.js complements Vue.js nicely when used for its helper functions (especially d3-scale).

HTML getElementsByClassName returns HTMLCollection with length of 0

I am trying to use the js document.getElementsByClassName to locate an html element, which is actually the header of a table. For the following codes: console

Create li from loop through array and display to HTML as a list

I am learning javaScript and I want to loop array and display to HTML as a list. How can I do that? Array: var array = ['Slide 1', 'Slide 2', 'Slide 3', 'Slid

Javascript - Web Audio API -- Range type Input is not dynamic in Firefox, but it is dynamic in Chrome -added reprex

The gain controller works dynamically on chrome, but in firefox it does not. I need to re-play audio file for browser to recognize new input value of the range

Bind event with form in JavaScript

I am creating form using JavaScript. Like below var form = document.createElement('form'); form.action = 'abc.com'; form.noValidate = true; form.id = 'myForm';