Skip to main content

All Questions

Tagged with
0 votes
0 answers
19 views

Why does my resetChallenge() function not completely reset the progress and badges in my JS web app?

I'm building a small web-based challenge tracker using JavaScript and localStorage. Everything works fine, except for the resetChallenge() functionality. When I reach 100% progress on a task, I call ...
Rutul Manani's user avatar
-2 votes
1 answer
33 views

"event.preventDefault() not working for dynamically created form elements – how to fix?" [closed]

I'm trying to use event.preventDefault() on a submit button inside a form that gets added to the page dynamically using JavaScript. However, it doesn't seem to work—the form still submits and the page ...
Dhruv Chavda's user avatar
0 votes
0 answers
62 views

Why isn’t my button’s click handler updating the <div> text? [closed]

I’m new to JavaScript and I have a simple page with a button and a <div>. I want to change the div’s text when the button is clicked, but nothing happens. var btn = document.getElementById('...
yao lee's user avatar
0 votes
0 answers
19 views

Why does offsetHeight log an increased height when called from object than what is shown in the object log itself?

I have an object taken from the DOM who's actual offsetHeight I can not correctly get. When trying to console.log the object to check the property, it does show the correct offsetHeight. But when I ...
foooch's user avatar
  • 1
2 votes
1 answer
77 views

How does JavaScript event delegation improve performance in large-scale DOM structures?

I’ve read that using event delegation by attaching a single event listener to a parent element is more efficient than adding multiple listeners to child elements. However, in a real-world scenario ...
0xMohamed's user avatar
0 votes
1 answer
57 views

How to replace self iframe with a new app

I have a parent application that embeds my Angular landing page inside an (iframe-div). This landing page displays icons for multiple apps. When a user clicks an icon, I want to: Replace the current ...
Turumella Aditya 's user avatar
1 vote
1 answer
88 views

Why is my HTML canvas appearing blurry after I dynamically set its dimensions in pixels? [duplicate]

I'm trying to create a canvas application which uses a custom-defined responsive coordinate system. Like the viewbox (from SVG). I know canvas inherently uses a pixel based coordinate system. My ...
Abb's user avatar
  • 71
0 votes
4 answers
213 views

Protecting HTML DOM attributes from DEV tools

I need to be able to store protected, DOM element, attributes at the UI. (For example, I want to store the DBKEY of the target database row along side the matching table row.) As I can see no way of ...
McMurphy's user avatar
  • 1,340
1 vote
0 answers
42 views

DOM Elements only generating after using the inspect-element tool in Chrome/Firefox [duplicate]

I'm trying to create a script that automatically plays a video whenever it's paused on a third party website. The issue I'm having is that the HTML elements in the page seem to be generated only as I ...
Hackz Lenny's user avatar
0 votes
0 answers
40 views

How to Reliably Extract Hidden Detailed Email Headers in Gmail using a UserScript?

I am developing a UserScript for Gmail to copy comprehensive email details, including the full header information (Sender, All Recipients, Date, Message-ID, 'mailed-by', 'signed-by', etc.). The header ...
Marco Fanelli's user avatar
1 vote
0 answers
111 views

DOM elements correctly initialized but not visible after slider transform

I am dynamically adding DOM elements during initialization using JavaScript. All the elements are correctly added to the DOM (see developer tools screenshot — all tags are inside the container). ...
Hoon's user avatar
  • 11
-1 votes
0 answers
43 views

How to have 20 buttons with different texts when pressed in JavaScript? [duplicate]

I have about 20 buttons in my HTML code and I want to write a JavaScript code that changes the content of a button when it is pressed. Every button needs to have its specific content that it will ...
Programmer's user avatar
-2 votes
1 answer
62 views

Which event should be triggered to accept input?

Background I am still learning a bit about creating DOM JavaScript methods so I apologize if this is something that is considered straight forward or I am missing something very simple. I have a few ...
Eric F's user avatar
  • 954
0 votes
0 answers
46 views

`querySelector` traversal by order of the number of child nodes?

In the MDN documentation, it says The matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through ...
Masquue's user avatar
  • 322
0 votes
1 answer
58 views

React: "appendChild" not working because parameter is not of type "node" even though I am using the "createElement" function?

So in my react app, I have a SVG container and I am attempting to append a tag (which has paths inside it) to it. I am referring to the SVG container with a ref. My code does the following: let ...
JackieChilesTheSecond's user avatar

15 30 50 per page
1
2 3 4 5
1870