Skip to main content

Questions tagged [dom]

The Document Object Model(DOM) is a way to programmatically refer to the elements of a markup language like XML and HTML. Use with [javascript] or any other programming language that has a DOM parser

0 votes
0 answers
15 views

Can't access element's properties using DOM in p5.js

I am trying to expand on The Coding Train's Monty Hall Problem demonstration using p5.js, and I am stuck in trying to implement an automatic mode. Everything works fine, except that the background of ...
Ardi's user avatar
  • 35
0 votes
2 answers
25 views

Selecting elements in HTML using tree generator extension

I have recently been trying to understand how to select elements and manipulate them using the html tree generator and JavaScript. How do I select the second last element of the last element child and ...
Kepher Ashitakaya's user avatar
0 votes
2 answers
42 views

localStorage Value is Stored and Loaded Correctly but Not Applied to Checkbox Input

I am trying to use localStorage to store and load the checked state of a checkbox. The values are being correctly stored and retrieved from localStorage, but the checkbox is not reflecting these ...
Muhammad Aleem's user avatar
-1 votes
0 answers
9 views

React useGsap with scrolltrigger not updating actual width of the DOM element

/* eslint-disable @next/next/no-img-element */ "use client"; import { useLayoutEffect, useRef } from "react"; import { useGSAP } from "@gsap/react"; import { ...
Xiaohu Zheng's user avatar
0 votes
0 answers
45 views

ClassList property isn't working when using an Event Listener [closed]

const heading = document.querySelectorAll('h2'); const para = document.querySelectorAll('.text'); heading.forEach((head, index) => { para[0].style.display = 'block'; head.addEventListener('...
Nail Val's user avatar
-1 votes
1 answer
18 views

Is the DOMRect from .getBoundingClientRect() live or immutable?

Let's say I get a DOMRect object from calling .getBoundingClientRect on an element: let domRect = el.getBoundingClientRect(); If I keep this object around and the bounding rectangle of el changes (...
Jo Liss's user avatar
  • 32.2k
0 votes
0 answers
13 views

Chrome Extension that adds an element left of all google search results

I am creating a chrome extension that inserts an element in front of every google search result. I am doing this by looping over all div's with an id of "a h3" on the google search page. ...
Bart S's user avatar
  • 13
1 vote
1 answer
22 views

what is the difference between .getBoundingClientRect().top and .getBoundingClientRect().y in javascript?

im really confused about the difference between these two methods. every time i use theme the have the same value so what is the difference? heres the code i tried as an example. const btnGetCoord = ...
Mobin's user avatar
  • 11
-3 votes
1 answer
44 views

What's the difference between className and classList.value?

Before you mark this answer as duplicate, I'm talking about "classList.value", not "classList". What are the differences between: element.className = 'main'; element.classList....
Tigerrrrr's user avatar
  • 1,071
0 votes
0 answers
26 views

How to console.log every time document.title is set? [duplicate]

I'm debugging some messy code base and I'm trying to figure out where document.title is being set (there are too many places and libraries calling document.title = foo). My plan is to override the ...
Vencovsky's user avatar
  • 30.7k
0 votes
1 answer
29 views

Chrome outputs emtpy document fragment to the console before inserting it to the dom

When inserting a document fragment to the dom Chrome browser outputs empty document fragment to the console whereas Firefox outputs non-empty fragment before inserting and empty fragment after ...
user2227119's user avatar
-1 votes
0 answers
24 views

What is the point in using for example StAX for signing / verifying signatures if the elements get buffered anyways?

I have been trying to use Apache Santuario to sign and verify signatures of large xml documents in Java. If it gets to really big files I still regularly get Java out of heap space and memory errors. ...
ylr's user avatar
  • 9
0 votes
1 answer
25 views

document is not defined in Astro projext even after adding client:load directive

I had a basic html and css with with vanila javascript which works with keyboard interactions and now transformed to astro but getiing error document not defined and sugegsted to use client:only I ...
xkeshav's user avatar
  • 53.5k
0 votes
1 answer
18 views

Keep references to iframe and insert them back to DOM without a reflow, repaint inside iframe

I have a website that loads some of the subdomains within an iframe. It could be 5 or 10 or any larger number of iframe. Users have the option to switch between these iframe. At any point only 1 ...
Ivin's user avatar
  • 4,615
0 votes
1 answer
100 views

What does mean Sync/Async in event table

I came across an interesting table of events at https://www.w3.org/TR/uievents. However, I am not familiar with the category Sync / Async. Event Type Sync / Async Bubbling Phase Trusted event target ...
MaximPro's user avatar
  • 570

15 30 50 per page
1
2 3 4 5
2784