Forgive me if this is a really stupid question, but I haven’t found any answers yet – or maybe I don’t know the correct thing to ask for. Given the following files that are part of the same project: MyProject.html MyProject.css MyProject.js (and a MyProject.py that runs on the server to make…
Tag: html
How to remove elements which i find with find() jQuery?
I have an element in which i want to find a specific class and remove those class. example How can i loop over the elements array and remove those classes i found? Answer
Js – Loop through array to create inputs and values only filling last item input value
I have a div with id=”inputs” on html and the following code on js: If the element of the paises array has a scripttag property, an input is created and value is filled with scripttag content. Inputs get created properly, the issue is that in the page all the inputs are empty except the last one c…
Apply two different colors as a gradient to different words in element
I’m trying to render the fizz buzz function in an unordered list, with each word corresponding to a different color (‘fizz’– green, ‘buzz’–blue) like so: I’m successfully rendering “fizz” and “buzz” in their colors on their own, but when …
How to make an active navbar link when it shows its page using react-bootstrap
I’m using react bootstrap and react in the development of my portfolio app, however, I just need one small detail to add and can’t find the right method to do it. I need to make the link on the navbar switch color depending on the page, for instance if I’m on the home page, “Home”…
How can I add new list items on field input?
I am working on a simple to-do app. I would like to add a new element after user clicks on enter in the input box, and nothing happen. I tried lot of ways, I will share the recent code. Do you have any suggestions? Thanks a lot. UPDATE: It finally works. UPDATE: It finally works. UPDATE: It finally works. Ans…
HTML + JS: Clear File Input on button click
I want to tell my backend, I deleted the assigned file it already loaded: where the onclick function looks like: my problem now is: I can differentiate the request in the browser Network tab whether I do nothing or hit the delete button. Both times the input field does not show up. I wanted to add ipt.value=&…
Using computer date and adding a day indicator
I have been trying to display the following “on this 4th day of January in the year 2022” using javascript on an HTML page but for some reason it is displaying today as the 2nd and not the 4th and where I want to display ie. 4th March 2022 (today +89 days) it is failing to do so… So the
Change which image is displayed on hover and click
I’m not a developer. I’ve been however tasked with coming up with a solution for a small project at work with jQuery and I have no clue where to begin. Here’s my codepen: https://codepen.io/axo1/pen/mdBLRjL What I need to is this (all graphics and texts are placeholders): What I managed to a…
Keep toggle switch enabled or disabled when page is switched or refreshed
I got a toggle that switches between dark mode and light mode: Then I got a script that switches to dark mode when the toggle switch is clicked: But when I refresh or switch page, the toggle switch is reset. How can we use localStorage to save the toggle switch status and load the current status when switchin…