Skip to content

Tag: jquery

How do I change the date format?

This is my js function to fetch data from database. The data is being dynamically appended data to my modal popup from the js page. Currently the date format shown, is “2018-06-09 15:43:44″(as stored in database). I wish to change the date format that is being displayed to dd-MMM-YYYY. Is there a …

Get the value of a radio input button using jQuery

I’m trying to get the value of the radio button that has been clicked, and I’m using the code below. But I’m getting the following error: jquery-3.5.1.min.js:2 Uncaught TypeError: Cannot read property ‘toLowerCase’ of undefined The code that I have used: Answer The issue is that …

How to put only one table td into an array

I have a table like this: I want to put the td “empid” into an array. Here’s what I’ve done so far: It adds the whole td’s to array though, I’m wondering how to add only a td to array. thank you Answer You need assign an id to your empID input to be able to find it from the

Detect collision (video game js)

I am building a video game where fireballs drop from the top screen. The spaceship, moved by controllers, must avoid those fireballs in order win. My issue is that I do not know how to detect when the spaceship collides into fireballs. However, I found this link: Detect if animated object touched another obje…