I am grabbing the innerHTML off of a clicked list item in an unordered list. I save this string to a variable and I want to call a function with the same name as this variable.

I've done some research and found some different articles but none of it worked. eval was referenced as a haphazard way of doing it, but I could not get that to work. Also another was using Window but the code didn't work for me.

How can I call that variable as a function. i.e. clickedName()

right now calling clickedName() gives the error

```
Uncaught TypeError: clickedName is not a function
    at HTMLUListElement.<anonymous> 

```

Here is the code I am using:

index.html

```
<div id="myDiv">test</div>

    <ul id="parent-list">
        <li>Cats</li>
        <li>Dogs</li>
    </ul>

```

script.js

```
document.getElementById("parent-list").addEventListener("click", function(e) {
    if (e.target && e.target.nodeName == "LI") {
        // console.log(e.target.innerHTML + " was clicked");
        // call function respective to element clicked
        let clickedName = e.target.innerHTML;
        console.log(clickedName);

    }
 });

function cat() {
    const myElem = document.createElement("div");
    let myString = `<div>Meow, Meow, Meow</div>`;

    myElem.innerHTML = myString;

    // put on page
    document.getElementById("myDiv").append(myElem);
} // catClick

```