JSFiddle - React, Tailwind, and code Playground

by amir_ch

HTML

I want to learn:<br>
<button data-message="Great!">JavaScript</button><br>
<button data-message="OK">Cobol</button><br>
<button data-message="Really?">Fortran</button><br>
<button data-message="Are you crazy?!">Turbo Pascal</button><br>

CSS

button{
    width: 120px;
}

JavaScript

$("button").on("click", function(e){
    alert(e.target.getAttribute("data-message"));
});