Question: why does View::make() not exist in laravel docs?
I have gone through on xVersion/views pages of all versions of Laravel docs, but I couldn't find any statement about View::make(). who can explain to me how it works?

additional info, I'm learning Aimeos Laravel package.
I don't think View::make is from Aimeos packages.
because, I see [![enter image description here](https://i.stack.imgur.com/EihpW.png)](https://i.stack.imgur.com/EihpW.png)

composer.json

```
> "require": {
>         "php": "^7.2.5",
>         "aimeos/aimeos-laravel": "dev-master",
>         "fideloper/proxy": "^4.2",
>         "fruitcake/laravel-cors": "^2.0",
>         "guzzlehttp/guzzle": "^6.3",
>         "laravel/framework": "^7.24",
>         "laravel/tinker": "^2.0",
>         "laravel/ui": "^2.4"
>     },

```

Answer: 
You are adding the `onclick` click handler to the array of elements instead of the elements themselves - you need to add a click handler to *each* of the elements, like this (see comments for more info):

```
// 1. Use querySelectorAll to get a NodeList that we can add the listener to
let options = document.querySelectorAll('.option');

// 2. loop through the options and add the event listener to each element
options.forEach(option => {
   option.addEventListener('click', function(){
      unselectAll();
      this.style.backgroundColor = "#333";  /* add colour to clicked element only */
   } );
});

```

**Working Example:**

```js
let options = document.querySelectorAll('.option');

let i;
function unselectAll() {
    for (i = 0; i < options.length; i++) {
        options[i].style.backgroundColor = "";
    }
}

// loop through the options and add the event listener to each element
options.forEach(option => {
   option.addEventListener('click', function(){
      unselectAll();
      this.style.backgroundColor = "#333";  
   } );
});
```

```css
.container {
  background-color: #333;
  padding: 10px;
  margin: 10px;
  width: 150px;
}

.option {
  background-color: #888;
  padding: 10px;
  color: white;
}
.option:hover {
  background-color: #555;
}
```

```html
<div class="container">
  <div class="option">Option</div>
  <div class="option">Option</div>
  <div class="option">Option</div>
  <div class="option">Option</div>
  <div class="option">Option</div>
  <div class="option">Option</div>
  <div class="option">Option</div>
</div>
```
You can achieve it with vanilla JS, but since you mentioned jQuery, here's my take:

CSS class

```
.option-clicked{background-color: #333;}

```

JS

```
$(".option").on("click", function(){
  $(".option").removeClass("option-clicked");
  $(this).addClass("option-clicked");
});

```

<https://jsfiddle.net/hv0qnwsx/9/>

Essentially everytime you click an ".option" element, the ".option-clicked" class is removed and then it's added to THIS particular ".option" that you clicked. Hope it's clear enough!