I am looking for way to select element inside of already located element in variable. For example I have selected a container: I know, that inside are array of a elements, which I want to select as well. Which method should I use? in jQuery there are method find(). So I need the analog for JS. Or I need to
Decrement function in Reactjs doesn’t work
I am using ReactJs and React-dom in 17.02 version. I had the same problem described in this question: a value to increment and decrement using button. I used the solution proposed, changed my previous code. From this one: To this one: But I see this error in the console TypeError: Cannot read properties of un…
JavaScript – Confusion between global classes and inheritance
Total begginer who learns JS here. I don’t understand why when you declare a variable it doesn’t TOTALLY inherit of it’s parent class methods, for e.g.: Why don’t the variables inherit of all of the methods of it’s parent classes? Instead of that you need to mix between the fonct…
React form how to get user data based on a toggle on/off
I have a form in React JS with one toggle/switch. If toggle/switch is on, then two inputs appear in the screen. So i want to get user data if the user types in inputs and the toggle/switch is on and stays on. So if the user types in inputs but he toggles/switches again to off then input values get reset
how to prevent pointer-events:none affect a button insdide of element with this style
I want the button inside the .container to be clickable, even though it has the pointer-events:none property. The context is this: in my real code, I must prevent that a parent div (something to the style of the div that has the class .container) cannot be dragged, or click pressed and dragged somewhere. I th…
How to not show empty sub-objects in a js array
I have my data set, and I was been able to filter it by EmployeeId from mine subobject. However, I don’t want to filter those empty objects that theirs subobjects GroupedServices does not contain any items (length is 0) Here is my working example: https://jsfiddle.net/sko3y1vq/6/ Thanks Answer Use Arry.…
Is there a way to set the first element in this .map method to a default class on load?
I am currently rendering three buttons using a .map method in React. The buttons are being pulled from an array in a useState. When clicked, the buttons have a .active class added to them. How can I set the first element to have the .active class when the page is first loaded? Current Code: https://codesandbo…
Uncaught DOMException: Failed to execute ‘createElement’ on ‘Document’: The tag name provided
i had created card component and i called in my ProductPage.js after that i am getting error like Uncaught DOMException: Failed to execute ‘createElement’ on ‘Document’: The tag name provided (‘/static/media/Card.c3b0a67ff849f2bda062.JS’) is not a valid name. initially it w…
how to post data using AJAX with validation using bootstrap 5?
How can I post ajax with form validation in bootstrap 5 ? I have a big problem with this. Can somebody help me? Answer The above starter code provided by bootstrap documentation uses the checkValidity() method of JavaScript Constraint Validation API to validate the form. The HTMLInputElement.checkValidity() m…
Variable of function always returns undefined
The idea: I want to return a variable from a function and then output it using console.log(). The problem: I can’t just use return result because then nothing is returned. I don`t really know how else to return the variable. I have already looked at SO posts like this one, however I probably lack suitab…