JSFiddle - React, Tailwind, and code Playground

HTML

<h1>
 Banking Simulation
</h1>

<h3>
 Current Balance: 100
</h3>

<input id = "depositAmt" type = "text" value = "100" />

<button id = "submitBtn" value = "Submit" > Submit </button>

JavaScript

function check_input_field()
{
	alert( "inside check_input_field()" );
  alert( "value of input is: " + this.value );
  
  // == withdrawAmt holds the value that the user inputted into the <input/> tag
  var withdrawAmt      = parseInt(this.value);
  var currBal          = 100;
  var maxWithdrawAmt   = 500;
  
  alert( "new currBal: " + (currBal-withdrawAmt) );
  
  /*  =========================================== 
  YB 1
  =============================================== */
  /* == check if withdrawAmt is equal to ""
  a. when true, alert "empty field"
  b. when false, alert "next check"
  */
  
  /* ============================================= 
  YB 2
  ================================================ */
  /* == check if withdrawAmt is not equal to "" OR "0000"
  a. when true, alert "invalid input"
  b. when false, alert "blank check passed"
  */
  
  /* ============================================= 
  YB 3
  ================================================ */
  /* == over draft check
  check if the withdrawAmt is greater than the currBal
  a. when true, alert "not enough funds"
  b. when false, do the following
     b.1. subtract withdrawAmt from currBal
     b.2. alert ( "new balance is: " + currBal )
  */
  
  /* ============================================= 
  OB 1
  ================================================ */
  /* == over draft and max lim check 
  check if the withdrawAmt is greater than the currBal AND withdrawAmt is less than or equal to maxWithdrawAmt
  a. when true, alert "not enough funds"
  b. when false, do the following
     b.1. subtract withdrawAmt from currBal
     b.2. alert ( "new balance is: " + currBal )
  */
  
  /* ============================================== 
  OB 2
  ================================================= */
  /* == loop through array that is named this.value and count the occurance of comma in withdrawAmt. 
  a. when there are 1 comma, alert "thousand"
  b. when there are 2 commas, alert "million"
  c. when there...