JSFiddle - React, Tailwind, and code Playground

HTML

<!-- Select Basic -->
<div class="form-group">
  <label class="col-md-16 control-label" for="payment-method">Payment Method</label>
  <div class="col-md-16">
    <select id="payment-method" name="payment-method" class="form-control order-form">
      <option value="1">Online</option>
      <option value="2">In Store</option>
    </select>
  </div>
</div>

<!-- Text input-->
<div class="form-group">
  <label class="col-md-16 control-label" for="creditcard">Credit Card Number</label>
  <div class="col-md-16">
  <input id="creditcard" name="creditcard" type="text" placeholder="CC Number" class="form-control input-md order-form" onclick="ccGrey">
  </div>
</div>

JavaScript

function ccGrey() {
  if (document.getElementById("creditcard").onchane){
    alert("this doesnt work very well")
  }
}