How to disable a Button in HTML using jQuery?
<input type="button" value="Submit"></input>
Hi makenzi.exc,
Set the disabled property using jQuery prop method.
Refer below example.
HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> body { font-family: Arial; font-size: 10pt; } </style> </head> <body> <input id="btnSubmit" type="button" value="Submit" class="btn-disable" /> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script> <script type="text/javascript"> $(function () { $("#btnSubmit").prop('disabled', true); }); </script> </body> </html>
Demo
Screenshot
Downloads
Download Sample
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.