I’m downloading ID from localStorage.getItem(1,22,3,14….). I want every single ID to be executed in jQuery (if it exists on the website). I can execute the code for one ID, but I don’t know what to do to make each ID after the decimal point executed. I try so but it doesn’t pass. I have to loop it, right? can anyone
Tag: dom
Getting an uncaught error when trying to print an data array object in JavaScript
So I’m new to JS and doing an exercise where I wanna create a shopping cart. The requirement is to use “dynamic data source” and not hardcode attributes into the HTML so I’ve created this object that I want to just display in my HTML, for example the description, the image etc.. I got everything to work with “static” attributes
Does element.replaceChildren() function work with duplicate values, or what is stopping this from working
currently i am trying to replace an elements children with the same value in an array e.g: my code is this: currently the fill function works fine and as intended the mock element class also works fine Answer JavaScript objects are references. This means that there is only a single h.element in the memory of your whole program, so if
How do I use localStorage to remember a user’s name
This code has been checked for errors and none were detected. But, when it runs, it alerts null. For Sololearners my code bit: https://code.sololearn.com/WOv1cF0EewdB/?ref=app Why is this?* *jQuery answers are OK Answer You are not getting a hello alert is because you are checking getItem’s return value with === true and !== true. setItem will convert your value to string,
Javascript DOM capturing after using javascript to insert dom
I have a question regarding DOM manipulation, say I insert a grid using this function: afterwards, I try to grab all the vertexes with the class “vertex” using document.querySelectorAll(“vertex”) it doesnt work: console log of this returns: but this works: console.log of this actually returns all 9 divs I see that the difference is that grid__container is pre-defined in my
How can I detect the moment a specific DOM node has been downloaded by the browser, while the page is still loading?
I am writing a user script which needs to access specific DOM nodes on the page. To reduce latency and page re-layouting, I want to set it to // @run-at document-start instead of the usual // @run-at document-end, and run my code as soon as the DOM node I need has been downloaded from the server. If I just wait
How I can show a innerHTML inside another one?
Question: In this code I´m traying to show the local storage in DOM, how I can show the “li” of the second for inside of the “ul” in the first for? to show it like this? : This is the code I wrote, if you see in the case both innerHTML obviouly will be separate and I dont want that.
how to make multiple counter buttons not interfere with each other
So basically I am making an online restaurant website where you can order food. I am going to make cards for each food item listed. Right now, I am making buttons that add and subtract the number of each item the customer wants to purchase. How do I get the second button to effect the correct HTML rather than the
ReferenceError: document is not defined (JavaScript in VS Code)
Im learning JS. Found a good video “JavaScript Programming – Full Course” and stucked at the 2nd part where I need to use DOM. I have the HTML document, in i refered to the JS file. Other stuff working well, but this: let messageEL = document.getElementById(“message-el”) Always get this error: ReferenceError: document is not defined I installed live server, and
Why doesn’t window.getComputedStyle invoke recalculate styles and reflow?
Look at this example: and look at another one: Differences are minimal: in the first case I just invoke window.getComputedStyle(document.body) without getting property, and in the second case I doing it with width property. As a result in first one we don’t see recalculation styles and reflows but in the second one we see vesa versa situation. Why? Answer This