I have the following hmtl page, is it possible to add a class on the div(line 3) based on the selection of the "Transaction Type". I Need to add a class "has-error" on line 3 of the below html ("div class="tab-pane active has-error" id="tab-first") if i am selecting transaction type "Expense" from the select option and I need to replace class to "has-success" if i am selecting "Income" from the select option.
<html>
<body>
<div class="tab-pane active" id="tab-first">
<div class="form-group">
<label class="col-md-2 col-xs-12 control-label">Transaction Type</label>
<div class="col-md-3 col-xs-12">
<select id="wlt_txn_type" name="wlt_txn_type" class="form-control" required>
<option value="" disabled selected>Choose option</option>
<option value="Income">Income</option>
<option value="Expense">Expense</option>
</select>
<span class="help-block">Required</span>
</div>
<label class="col-md-2 col-xs-12 control-label">Transaction Date</label>
<div class="col-md-3 col-xs-12">
<input id="wlt_txn_date" Name="wlt_txn_date"type="date" class="form-control" required/>
<span class="help-block">Required,No Future Date Allowed</span>
</div>
</div>
<div class="form-group">
<label class="col-md-2 col-xs-12 control-label">Select Wallet</label>
<div class="col-md-3 col-xs-12">
<select id ="wlt_pcat" name="wlt_pcat" class="form-control" required>
<option value="" disabled selected>Choose Wallet</option>
</select>
<span class="help-block">Required</span>
</div>
<label class="col-md-2 col-xs-12 control-label">OD Limit</label>
<div class="col-md-3 col-xs-12">
<input value="" class="form-control" readonly/>
</div>
</div>
</div>
</body>
</html>
Thanks in Advance