I have two textboxes in which I want to limit the user, so he can only use Y or N in that textbox. How can i achieve
.yes_or_no{
font-size:xx-large;
font-weight:900;
color:#000;
}
<input id="t1" class="yes_or_no" type="text" class="typing1" name="txt1" oninput="this.value = this.value.toUpperCase(), this.value.replace(/[^0-9]/, '')" maxlength="1" />
<input id="t2"class="yes_or_no" type="text" class="typing2" name="txt2" oninput="this.value = this.value.toUpperCase(), this.value.replace(/[^0-9]/, '')" maxlength="1" />
sizeandmaxlengthattribute example.minlength and maxlengthto your inputmaxlengthis just part of the proposed solution? If you offer only two choices, why not use radio buttons?