I am trying to figure it out whole day already and nothing seems to work, so I would really appreciate help. Here is simplified example of what I have in HTML: Result is: What I would like to achieve is to show middle-div only if small-div has any content, so the result would be: I have tried this approach: and
Tag: javascript
Search Filter Javascript – Search for multiple texts inside a cards and
I’m currently trying to make a dynamic search bar with JavaScript which can search inside cards, the title and multiple keywords. I currently have something but it doesn’t seem to work properly. When I try searching for something even though the input value matches with the title or any of the keywords it still doesn’t show it. For example, if
Map + filter – Showing people that have < 18 years and abbreviate names
I wanted to be able to transform the age into a single array, so I would already know how to filter, then apply the mapping to only show people over 18 years old, in addition, to present the abbreviated names of the people. Here what i tried to do: Answer If I’m understanding correctly the desired outcome is [Ra, Ma]?
How to handle V-show dynamically
I am trying to build an Ecommerce shopping website. I import data from JSON file and by using v-for loop I am able to print data. There is one section in each order that is Show Order Details option, after clicking it one more section called order details will show. I used v-show tag to open the details section. But
How sum specific array values with input onChange
I’m have a list of objects I need to sum two values in array with onChange input On every change values is summed I’m create input form and it’s works but change all my mapped values at once How can i change only one item in array at once on every onChange event? Answer You can make inputValue store an
EventListener not firing – Dynamically create and download calendar event
I am getting the plain text of outlook calendar events and converting them to an ics for download with Tampermonkey. The button worked when I wrote this a couple of years ago, but now it is not. I am not sure if I need to grant permissions now or if something else broke it. The button is added just fine,
why is MUI CORE basic rating code is giving me setValue as undefined?
i tried using MUI CORE for first time and it’s giving me arror as i wanted to use active first rating and set value is not defined i Answer Ey! The only thing that i can see is that you are trying to use “setValue” in the “onChange” event handler for the “Rating” component, but there is not a “setValue”
How Do I Programmatically Change The SRC value of the images using JavaScript
The images do not have unique ids nor do they have unique classes. How do I change the src value for each element from the array of images. Answer The second argument of forEach is the index of the current iterated item. Grab the image elements with querySelectorAll, and then use forEach to iterate over them updating the src attribute
What is the best condition between negative and positive numbers to avoid repeating comparisons?
I would like to make a bunch of comparisons between numbers, both negative and positive and based on that trim the number toFixed decimal points, but I would like to avoid lengthy conditions. Here’s a code sample: What is the best way to refactor and perhaps to convert the number to absolute value, add a flag to indicate if the
How do would I create a cloud varible (High score) for a game
I’ve looked at various wbsite but none seem to awnser my qestion. I have intermediate-basic knoledge in javascript. Intermediate-Advance HTML and intermediate Knoledge in CSS and basic knowledge in PHP. Answer My take on a solution for this will need you to be a little familiar with Node. Just some basics What we will be doing is creating a little