Skip to content

Tag: html

Dropdown on click doing nothing

I am just starting JS, so this may be a stupid question. I want to make a dropdown, where if you pick one option the related paragraph would be visible. I didn’t really know how to start this so I created the cars function to make the “e38value” paragraph visible when clicking the e38 button…

Why I can’t add “keydown” event on td >p element?

I want to trigger some action when user press a key inside a p tag inside a td element, here is the HTML of a “td” on my table. The problem is that when I add the keydown event to every paragraph element I don’t see any response. Here is how I did it. I had some other “keydown” e…

How to handle collisions in Phaser

I want to make objects push away from each other in my Phaser game (arcade physics). To do so I’ve tried to use the collider function: But I always get TypeError: undefined is not an object (evaluating ‘t.isParent’) It looks like this is error rises during the update process as it’s ri…

setTimeout runs only once then not working

I got JS as below. I want all bootstrap alerts to dissaper after 1 sec. It works just one time but when i add more alerts they stays as they are. What is the cause of that? setTimeout: Answer That’s because setTimeout is only called once. If you want to have multiple calls, use setInterval, that is used…