I am trying to match one className called invalid. My classes have a default class of 'form-control' and another which is concatenated to the class by the class called ' invalid' if a mandatory field has not been supplied with data which makes 'form-control invalid.
My code works but I would like it to be more efficient by matching only the 'invalid' class and not the whole 'form-control invalid'.
if (txtCust.className != 'form-control invalid') {
btnSave.onclick = "";
}