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…
Tag: html
is there any other than querySelector and querySelectorAll that i can use
How can i run all these paragraph? i know querySelector returns the first element but i want to know how can i return both paragraph. I already tried using querySelectorAll but i do not know how to write it. Sorry iam still learning btw Answer I guess this is what are you looking for:
What’s the best way to code an input tag with certain locked characters?
Introduction I would like to make an input of a fixed length that you can only fill some of the characters, for instance let’s say I have __llo w_rld! and i want the user to fill in the gaps, but not allow to modify the prefilled characters. Ideas I thought of using an input tag for each character and m…
Loading spinner disables HTML5 required attribute
I have submit button (bootstrap) where i submit some data from input fields to my PHP query. I have added to this submit button a loading spinner after the button has been clicked by the user. Since i have added the spinner id to the button the HTML attribute for “required” is not longer working. …
Unexpected DOM Ordering Behaviour With Element.prepend on Infinite Slider-Track Animation
I’m working on an infinite slider but I’m experiencing a strange bug with DOM ordering. At the end of each animation iteration, the last child element is supposed to be prepended to the div.slider-track element so it renders at the beginning of the slider and pushes up the other cards before the n…
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=…
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…
HTML video player sound cuts out after through skimming video
I’m currently having issues with a dynamically loaded html video player on my site, where I set the source of a HTML video player using JS by clicking on a button. The problem is, once the video is playing it runs fine, but as soon as I skim the video or jump ahead, doesn’t matter how far, the sou…