JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1 id="header">Hello! Play with me!</h1>
</body>
</html>
JavaScript
$("#header").click(function() {
if ($(this).text().indexOf('Hello') != -1) {
$("#header").html("0 - click again!1");
} else if ($(this).text().indexOf('0') != -1) {
$("#header").html("1 - click again!1");
} else if ($(this).text().indexOf('1') != -1) {
$("#header").html("2 - click again!1");
} else if ($(this).text().indexOf("2")) {
$("#header").html("3 - click again!1");
}
});