JSFiddle - React, Tailwind, and code Playground

by GoranMottram

HTML

<table>  
    <colgroup>
        <col width="200px" />
        <col width="300px" />
    </colgroup>    
<tr>
              <td align="right" bgcolor="#693505">*New or Existing Customer</td>
              <td bgcolor="#693505">
              <select name="existing" id="existing" class="form">
                      <option selected="selected" value="New Customer">New Customer</option>
                    <option value="Existing Customer">Existing Customer</option>
              </select>
              </td>
            </tr>
             
             
            <tr>
              <td align="right" bgcolor="#693505">*Name</td>
              <td bgcolor="#693505"><span id="sprytextfield1">
                <input name="name" type="text" class="form" size="35" />
                <span class="textfieldRequiredMsg"></span></span></td>
            </tr>
           <tr>
              <td align="right" bgcolor="#693505">*Title</td>
              <td bgcolor="#693505"><span id="sprytextfield8">
              <input name="title" type="text" class="form" size="35" />
              <span class="textfieldRequiredMsg"></span></span></td>
            </tr>
</table>
<div id="existingCustomer">
<table>
    <colgroup>
        <col width="200px" />
        <col width="300px" />
    </colgroup> 
           <tr>
              <td align="right" bgcolor="#693505">*Company</td>
              <td bgcolor="#693505"><span id="sprytextfield2">
                <input name="company" type="text" class="form" size="35" />
                <span class="textfieldRequiredMsg"></span></span></td>
            </tr>
            
            <tr>
              <td align="right" bgcolor="#693505">*Address </td>
              <td bgcolor="#693505"><span id="sprytextfield10">
                <input name="billingAddress" type="text" class="form" />
                <span class="textfieldRequiredMsg"></span></span></td>
            </tr>
            
            <tr>
              <td align="right"...

JavaScript

$("#existing").change(function(e){
    
        var value = $("#existing").val();
        
        if(value == "New Customer"){
            $('#existingCustomer').slideDown('5000', function() {
            
            });
        }else{
            $('#existingCustomer').slideUp('5000', function() {
            
            });
        }
    });