JSFiddle - React, Tailwind, and code Playground
HTML
<button onclick="hello()">Click Me</button>
<p class="myelement">Hello world 1</p>
<p class="myelement">Hello world 2</p>
JavaScript
function hello(){
alert('hello!');
var ele = document.getElementsByClassName("myelement");
ele.style.setProperty("text-decoration", "line-through");
}