JSFiddle - React, Tailwind, and code Playground
HTML
<div id="theVictim"></div>
CSS
#theVictim {
width: 100px;
height: 100px;
background: gainsboro;
}
JavaScript
var optionalSelector = "$";
(function() {
(this[arguments[0]] = function constructor(input) {
if (!(this instanceof constructor)) { return new constructor(input); }
this.elm = document.getElementById(input);
}).prototype = {
blink: function() {
function changeDisplay() {
if (this.elm.style.display != "none") {
this.elm.style.display = "none";
} else {
this.elm.style.display = "block";
}
}
setInterval(changeDisplay, 1000);
},
};
})(optionalSelector);
$("theVictim").blink();