I would like to know how to validate the credit card through Js.
Visa starts with 4 Mastercard starts with 51, 52, 53, 54 or 55; American Express starts with 34 and 37
Does anyone know how to validate this?
<fieldset class="fsResDir">
<legend>Dados do Cartão </legend>
<input type="radio" name="RadBand" id="visa" checked />
<label for="visa">
<img src="visa.png" />
</label>
<input type="radio" name="RadBand" id="mast" />
<label for="mast">
<img src="master.png" />
</label>
<input type="radio" name="RadBand" id="amex" />
<label for="amex">
<img src="amex.png" />
</label>
<label for="val" class="lab90">Validade:</label>
<input type="text" class="ent20Form" id="val" name="TxtValMes" />/
<input type="text" class="ent40Form" name="TxtValAno" />
<label for="num" class="lab90">Numero:</label>
<input type=text class="ent120Form" id="num" name="TxtNumero" />
</div>
</fieldset>