Skip to content

Tag: html

Cleaner way instead of running the function every second

I made a simple Coin System with JavaScript. And to make Upgrades, I made a button that gets enabled when it’s over 10. To make this permanently I run this function every millisecond with this: Anyway, is there a cleaner way to run this system without running the function every millisecond? It looks lik…

How can I save checkbox state to my database?

I’m trying to create a Todo-list app using (nodejs,ejs…) so for every todo I create a checkbox. If someone finishes his job and uses the button bin recycle to delete it, I save that using MongoDB but I’ve a problem when checking. When I reload the page this checked box disappears. In other w…

Create a +1 Animation when button is clicked

I was making a game where you get money for clicking on a button. Here’s a part of it: Later i was looking in the Internet and i found a website called Cookie Clicker and i saw this animation that when you click the cookie, a +1 is going up and fades away (It is not so important that the

Trying to position JavaScript variables

I’m just learning javascript and I’m trying to center the theDate var by using the style tag but it stays to the far left anyone see where I’m going wrong? Answer your css is centering the element with the id theDate, so wrap that string in a with that id document.write(‘<div id=&#8…

innerHTML returns undefined – JavaScript

I’m creating a game on the web for my studies. I need to create a card game where each card has its own data (number and power name), data is taken from data.txt and put in an array that is then randomized. data.txt looks something like this: Play() function scrambles the deck when the PLAY button is pr…