JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" onclick="autocomplete();" value="Click me!" />
    <input type="button" onclick="whatever();" value="Me too please!" />
    <input type="button" id="id1" value="Second attempt" />

JavaScript

console.log(autocomplete)

function autocomplete() {
    alert("This doesn't work, only in IE compatible mode or other, lder browsers :(");
}

function whatever() {
    alert("This works, obviously...");
    eval("console.log(autocomplete.toString())");
}

document.getElementById('id1').onclick = autocomplete;