Need help with a checkbox
and a nearby textbox
. When the checkbox
is checked, the border color of the textbox
should turn green. If the checkbox
is unchecked, the border color of the textbox
should be red.
Jquery code:
$('#item_availability1_unlimited').on('change', function () {
if ($('#item_availability1_unlimited').is(':checked')) {
$('#item_availability1').css('border', '2px solid #11b818');
} else {
$('#item_availability1').css('border', '2px solid #F00');
}
});
I have completed the above part successfully, now I need assistance with the following:
If the textbox
is empty, the border color should be red. Once text is entered, it should change to green.