JSFiddle - React, Tailwind, and code Playground

by ganesh deshmukh

HTML

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<form name=loginForm id='login' action='' method='post'>
      <legend>Login</legend>
      <input type='text' name='email' maxlength="100" placeholder="Email"/>
      <input type='password' name='password' maxlength="100" placeholder="password"/>
      <div class="checkBoxGroup">
        <label for="Employer">Employer</label>
        <input type="radio" name="status" id='employer' value="employer">
      </div>
      <div class="checkBoxGroup">
        <label for="Staff">Staff</label>
        <input type="radio" name="status" id='staff' value="staff">
      </div>
      <input type='submit' name='Submit' value='Login' />
    </form>

JavaScript

$("input[name='status']").change(function(){
	if($("#employer").is(':checked')) {
				alert('employer option is checked');
	}
	else{
	  alert('staff option is checked');
	}
});