JSFiddle - React, Tailwind, and code Playground

by nosfan1019

HTML

<a href="#">click me</a>

<div id="demo1"></div>
<div id="demo2"></div>

JavaScript

function sayHello(name) {
  var text = 'Hello ' + name;
  var sayAlert = function() { $text(text); }
  sayAlert();
}

$('a').click(function() {
    $('#demo1').sayHello('Chris');
    $('#demo2').sayHello('Bob');
});