'Backdrop for mobile with Javascript

I need this kind of behavior like when we click on make we can open the next model list in the same section enter image description here

Please can you help me with how I can achieve this?



Solution 1:[1]

Im not sure about vanilla js but u can achieve this in ReactJS using react-router-dom package. you can add Link to each section which will replace that modal in the section without page reloading/refreshing.

Edit:

I have 2 ideas to to this with vanilla js but its a bit complicated and confusing.

  1. using appenChild() change section child with onclick.

  2. adding display: none to all and changing display: block for the once to display

this will not change reload or take to new page but u will need to add js for onclick for each route/model

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1