Category "javascript"

How to trigger animejs on a specific Swiper slide?

You can see my code using this sandbox: https://codesandbox.io/s/strange-shtern-e98gvu?file=/src/App.js Basically, what I want to do is play the animejs animati

Mousedown event not added

I'm adding an event listener but listener didn't added and i have no errors. I'm going to make a word game. And the problem is so weird const alphabets = ["

how to set labeloffset dynamically in chart Js

I am using Chart.js, I have to generate stack bar chart based on fromMonth to toMonth selection. My bar chart option is: { "chartCanvasHeight": "200", "char

Angular MIME issues in Edge

I'm running into an issue with Angular where if I ng serve and deploy on localhost, the page loads fine. However if I use ng build and deploy remotely, I then g

Swap 3 divs and make the selection div go to the center

I have three divs and I want that every single time I click on any div, it will be swapped with a second div which is meant to be at the center. I have tried li

Why does a class have a "constructor" field in JavaScript?

A class is supposed to have a prototype field that supplies default fields. For example, prototype.constructor defaults to the constructor function (i.e., the c

How can I display an random quote from an Javascript Array in html?

im trying to make random quotes that are listed in an array appear on my website on reload however I cant quite get it to work Javascript: function textOfToday

Angular Material table filtering out all results when input is initially blank, will work after typing into input Only

So my table works really well, except that it shows no data until either a row is clicked or the filter is used. I am unsure as to what is going on here, not su

How to call render functions in Vue 3 composition api?

Back in vue 2 i used to call render() like that: export default { mounted(){ ... }, render(){ ... }, methods(){ ...

MockServerWorker is not handling responses when using fetch in react

I'm doing test driven development in react course - I'm trying to development test for post request. Below is by react code. import React from "react"; import a

How do I target all elements with the same class with getElementByClassName instead of just the first element with that class

I'm very new to JS, and really don't understand a lot of it. Trying to learn as I go. I'm trying to add some new divs to buttons to style them to look like the

get InputName of div element using js, no jquery please

I have a variable that consists of an HTML tag as below: let customDiv = '<div class="MuiAutocomplete-root" name="ApplyTo">Hello</div>'; I want to

ChartJs bar chart bar value displaying lower then Y axis value in pdf?

I have a created a bar chart by chart js , Below is my code version : 2.9.4 var xValues = ["Italy", "France", "Spain", "USA", "Argentina"]; var yValues = [3, 5,

Traverse from one cube room to another cube in three.js

I am trying to make series of 3D rooms with cubes. We can move from one room to another room. Please find the room designs spanshot. User should be able to mov

Size of divs in HTML

I want to reduce the size of these divs so that every row contain 3 cards at most. As I change the measurements in the CSS, it gets smaller and smaller. PS I'm

how can i validate data in dd-mm-yyyy format

I have the following date "13-05-2022" if (!validateDate(this.formGeral.value.data.singleDate?.formatted)) { this.errors.push('Data com formato inváli

VSCode API: Editor.edit editbuilder.replace fails without reason (possibly due to formatting?)

In my extension I want to edit the document on a few specific document edits. My actual use case is a bit complicated so I have created a minimal example. The c

Sync issue with iframe in Chrome and Edge

the following script is used to load in a IFRAME a web application. function openCashier(destination) { postIsAnonymous(function (data

Electron Remote process with user input width and height not working

I am having a problem with using remote windows in electron I am trying to process user input ans use that input to create a new window with a certain width and

Getting a NodeList of the HTML tags in Mithril

Is there a way of having a NodeList of the HTML tags in Mithril? I need to get the width of the blocks. Something like that on vanilla js: const blocks = Array.