I want change color title on click it.
I write next:

```js
window.onload = function () {
    var color = document.getElementById('input-color');
    var elems = document.querySelectorAll('.title');
    function chancheColor(){
        for (var i = 0; i < elems.length; i++) {
            elems[i].addEventListener('click', function () {
                color.click();

                color.addEventListener('change', function () {
                    var name = this.value;

                    for (var i = 0; i < elems.length; i++) {
                        elems[i].style.color = name;
                    }
                });

            });
        }
    }
    chancheColor();
};
```

```html
<input id="input-color" type="color">
<p class="title">First</p>
<p class="title">First</p>
<p class="title">First</p>
```

I simulate a click on 
color.click();
Is it true?

Now my function сhange the color for all titles
beacause I have a second cycle for (var i = 0; i < elems.length; i++)
I don't know, how get the current value of the title which was clicked.

And generally how is it possible to transfer a parameter in function if it is caused like this?
color.addEventListener('change', function () {});