Skip to content

Icon clicking to show the date

I am creating the input field to show the calendar date. Now I just only can click the input field to show the calendar date. Actually, I want to click the calendar icon to show the calendar date, then the calendar date will show in the input field, not click the input field to show the calendar. Hope someone…

Change image when another image is clicked

I am trying to change the big image when another small image is clicked, kind of like a product display on an e-commerce website. But my code doesn’t seem to work. Answer Don’t repeat JavsScript code. Instead delegate a click to every .button-container’s img element: Another suggestion is no…

Send input javascript, on Chrome

Does someone have any idea why only the second time I run my code it does work? https://youtu.be/yrD9jB1FXHo The code just sends a message in the search box. I’m testing it on chrome using the DevTools console (F12). Answer The problem is with the React JS used to design whatsapp web, so to manage this …

keyup or change event on input hidden is not working

If the Hidden input takes its value from a text input, how can I monitor the change and implement something when changing the Hidden core value? example: Answer You can fire keyup explicitly using: You have to just add this line: $(‘#input1’).trigger(“keyup”);

Javascript event listeners and arrays

I am trying to recreate a scratch-to-reveal-image effect with 3 images in an array triggered by 3 buttons. My event listener is not working, as you can see, it shows the same revealed images no matter the button. The event listener syntax has confused me a bit and I would like some help on that specifically. …

How to get specific key counts that are serials

There is a dynamic object with the item_description_ key suffix index. In addition to these keys, there are other different keys. How can I get the counts of the item_description_ keys? Expected result should be 3 in the above example. Answer You can use Object.keys to get all the keys of the object into the …