JSFiddle - React, Tailwind, and code Playground
by akang2
HTML
<input type="button" id="email" value="Click here to enter an email" />
JavaScript
//indexOf to test an address
//attach the prompt value to a var
function get_add() {
var bleh=prompt('gimme yer email','here');
if ((bleh.indexOf('@')!=-1)&&(bleh.indexOf('.')!=-1)) {
alert('Nice!');
}
else
{
alert('you fucked up');
}
}
var crap=document.getElementById('email');
crap.onclick=get_add;