JSFiddle - React, Tailwind, and code Playground

by kazumasa sait

HTML

<button onclick="alert('ボタンをクリックしましたね')">押してね</button>

<div><img src="http://placekitten.com/200/200" alt="猫画像"id="catImg"></div>

JavaScript

var catimg = 
document.getElmentById('catImg');
catimg.onclick = function() {
    //無名関数
    alert('猫画像をクリックしましたね?');

};