Using jQuery prop() method you can enable or disable a form element. From jQuery 1.6+ you can use jQuery prop() method.
You can enable or disable an elements on a page dynamically with jQuery by setting their attributes accordingly.
For jQuery 1.5 and below the .prop() function doesn’t exist, but .attr() method does similar thing.
$( "#elementID" ).prop( "disabled", true );
$( "#elementID" ).prop( "disabled", false );
Also Read:
$("input").attr('disabled','disabled'); $("input").removeAttr('disabled'); This will totally remove the disabled attribute from the element instead of blanking it out.
Read jQuery reference for more details.
Pain in muscles and joints can be a problem in everyday life, whether it involves…
Most modern businesses spend a lot of time thinking about digital touchpoints. Websites, email campaigns,…
While TikTok and Instagram battle for users’ attention with short vertical videos, Elon Musk’s social…
When you are looking to apply for a mortgage the one thing that most people…
Once you've memorized basic blackjack strategy, it's time to delve deeper into the game. Advanced…
Yoga is no longer just a physical practice. Yoga is popular as a lifestyle practice.…