I have a shopping cart icon from FontAwesome in which I want to assign the sum of items selected from inputs. I’ve added the number of items using a JavaScript function but I can’t manage to show this number into the icon content. The content value of the icon is taken from the HTML attribute valu…
Tag: html
Hide an element per multiple scrollable divs
I am trying to fade out a logo at the top of three divs onscroll. I would like it so when a user scrolls one div, the logo fades from div that is being scrolled, not all of them. There is also a problem with scrolling to the top again, the logo is faded. It should return to full opacity.
Change the background-color on a button after clicking
Hello i write on a rating button and i wanted to change the background color from the button after i clicked it but my code does nothing. Answer const btn = document.querySelector(‘.btn’); is only targeting the first button. You need to use querySelectorAll to select all buttons and add event list…
How do I display a url link when using a javascript to cloak the full referal link?
I’m cloaking a referal link so I’m using an onClick function to open a new tab navigating to the linked website. However, I still want to display the url when the user hovers over the hyperlink text. So if the referal link is: www.somelink.com/long_ref_code then I would like to display only www.so…
printing arry of object in object in Html from JS and Json
I have an array in JSON, I need to pass it in JS that its printing will be like the image in HTML After trying to print to console.log – it really prints in order It’s just that during the creation of the HTML elements everything was a mess This is my array: And I want it to be printed
How can I use JavaScript to delete a row in an HTML table and its associated data when a button is clicked?
How can I use JavaScript to delete a row in an HTML table and its associated data when a button is clicked? What is the most efficient way to identify the row to be deleted, and what method should I use to remove the row from the DOM? Additionally, how can I ensure that the deletion of the row does
How to get textContent including childNodes?
I have some plain text content in paragraphs inside a <main> HTML element. the paragraphs are separated by new lines (n), not in <p> tags, and I would like to automatically wrap them in <p> tags using JavaScript. Example content: Inside of <main> there may be <img> elements. I wa…
Failed to resolve module specifier “three”. Relative references must start with either “/”, “./”, or “../”
I am currently trying to load a .obj model into my three.js project. I feel like I have all the code correct becasuse my code compiles without any errors, but when I go to Google Chrome’s console it is giving me this error. . mainpage.html mainpage.js Answer Try changing: To -> Basically, you’r…
Using HTML and Javascript to make a concrete supplies calculator – Takes a value of both ____m3 and a select option (mpa) to give a total price
This is my first time asking a question on Stack Overflow so apologies if I get something wrong. I am currently building a web calculator for a concrete company. Here are the details of the inputs: There is a form with the following inputs: Input 1: Cubic Meters (m3) Input 2: Strength Input 1 takes a value be…
How would I select a group of buttons using classes and if any of them are pressed, a alert pops up
I tried using .addEventListener with querySelector, but for some reason it wouldn’t work. The error is Uncaught TypeError: Cannot read properties of null (reading ‘addEventListener’) I don’t understand why the error is happening either. Anyone have some knowledge they can share? ……