I have some(more than 10) inputs in my HTML form. On initial state all this inputs are disabled by default. There is also select element which changes exact inputs disabled property while selection made on it based on its selected value. In other words select element contains options which indicates which input need to be enabled. Now I want to enable exact input based on selected option. How it can be done?
Add a class to the 'exceptional' one, e.g. special
:
<input ... class='special' />
Then enable all but this with:
$('input').not('.special').removeAttr('disabled');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With