JSFiddle - React, Tailwind, and code Playground

by asifrc

HTML

<div id="pellalert"></div>
<div class="search-pell">
	<form id="pellform">
		<input type="text" value="Enter 13-14 PELL Score" class="search-input-bg-pell" id="pellscore"  />
	</form>
    <p>Enter any four digit number...</p>    
</div>

JavaScript

$(function() {
    //Set Form onsubmit
	$('#pellform').on('submit', function() {
		showpell_13_14( $('#pellscore').val() );
		return false;
	});
    //Set textbox onfocus
	$('#pellscore').on('focus', function() {
		if (this.value == 'Enter 13-14 PELL Score')
		{
			this.value = '';
		}
	});
    //Set textbox onblur
	$('#pellscore').on('blur', function() {
		if (this.value == '')
		{
			this.value = 'Enter 13-14 PELL Score';
		}
	});
    //Create a jQuery UI Dialog
    $('#pellalert').dialog({ autoOpen: false });
});

// Begin EFC Calculator for 2013-2014

function showpell_13_14(efc) {
	

  var pell;
  var ssg;
  var estpay;
  var monthpay;

	if (efc == 0) {
		pell = 5645;
		ssg = 0;
		estpay = -573;
		monthpay = 0;
	}
		
	else if (efc <= 100) {
		pell = 5595;
		ssg = 0;
		estpay = -523;
		monthpay = 0;
	}
		
	else if (efc <= 200) {
		pell = 5495;
		ssg = 0;
		estpay = -423;
		monthpay = 0;
	}

	else if (efc <= 300) {
		pell = 5395;		
		ssg = 0;
		estpay = -323;
		monthpay = 0;
	}

	else if (efc <= 400) {
		pell = 5295;		
		ssg = 0;
		estpay = -223;
		monthpay = 0;
	}
	
	else if (efc <= 500) {
		pell = 5195;		
		ssg = 0;
		estpay = -123;
		monthpay = 0;
	}
	
	else if (efc <= 600) {
		pell = 5095;		
		ssg = 0;
		estpay = -23;
		monthpay = 0;
	}
	
	else if (efc <= 700) {
		pell = 4995;		
		ssg = 76;
		estpay = 77;
		monthpay = 0;
	}
	
	else if (efc <= 800) {
		pell = 4895;		
		ssg = 176;
		estpay = 177;
		monthpay = 0;
	}
	
	else if (efc <= 900) {
		pell = 4795;		
		ssg = 276;
		estpay = 277;
		monthpay = 0;
	}
	
	else if (efc <= 1000) {
		pell = 4695;		
		ssg = 376;
		estpay = 377;
		monthpay = 0;
	}
	
	else if (efc <= 1100) {
		pell = 4595;		
		ssg = 476;
		estpay = 477;
		monthpay = 0;
	}
	
	else if (efc <= 1200) {
		pell = 4495;		
		ssg = 576;
		estpay = 577;
		monthpay = 0;
	}
	
	else if (efc <= 1300) {
		pell = 4395;		
		ssg = 676;
		estpay = 677;
		monthpay = 0;
	}
	
	else if (efc <= 1400) {
		pell = 4295;		
		ssg = 776;
		estpay = 777;
		monthpay =...