JSFiddle - React, Tailwind, and code Playground

HTML

<div id="fooBox"></div>
<button onClick="foo.display()">Click Me</button>

JavaScript

foo = {};

foo.display = function() {
		alert('d')
    this.elem = document.getElementById('fooBox');

    var script = document.createElement("script");
    script.type = "text/javascript";
    script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=foo.show";
    document.body.appendChild(script);
};

foo.show1 = function() {
    alert("test1");
};