Skip to content

Tag: javascript

How to change color of a piece of text in Javascript?

At first, I apologize for such a basic question, but I’m really new to javascript and I needed to change the color of a script’s loading percentage. The script snippet is this one: How do I change the color of Math.floor(100 * cnt / end) + “%”? Answer You can wrap that part of the text…

Add object to array in class component

I have a list of products (unordered list which I apply at the beginning and it shows on screen) and after click on one of them for example: milk, app should add it on screen to list “to buy”. But it shows on the screen after I click on another element or second time on the first one. It also

Wobble effect on letters

I’m trying to add a wobble effect on each letter but I can’t get it to work, I would like the letters to get a bit bigger while hovering them and making the effect run. I’m just learning javascript so I’m not really good at it, the snippet doesn’t work and I don’t know what…

Replace fetch link with html button

This code is designed to take a data from API, convert it to JSON and display it in the HTML page (with a specific design). There are two buttons on the HTML page that are for changing the page (to change the page, the URL sent to fetch needs to be changed by clicking the buttons (which is where my