JSFiddle - React, Tailwind, and code Playground
by akang2
HTML
<input type="button" id="butt" value="OMG THIS IS A SMALL BUTTON" />
JavaScript
//Creating and testing Regular Expressions
//grab user input and put it in a var
function theWorks() {
var userName = prompt('gimme yer name','now');
//the RegExp
var myExp = /alex[@][.]/i;
//testing the RegExp against string
if (myExp.test(userName)) {
alert('Im Alex too');
}
else {
alert('wtf who are you');
theWorks();
}
}
//grab the button and assign a var
var theButton=document.getElementById('butt');
theButton.onclick=theWorks;