Skip to content

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…

javascript: how to get all ids of a json array with for loop

I’m having a problem getting the different ids from my json object. I get are the id of the last item. This is the function: This is the json array I get: Thanks to all in advance Answer The concrete error in your code was this line: It needs a “+” before the “=” to add more stri…

span textContent split returns undefined in javascript funtion

I am trying to help a friend out with the following javascript. We both are new to javascript. We are trying to convert the date string to a different format. Based on internet search we understand that the date function expects the input string to be Date(year, month, day) format. To achieve that we need to …