किसी एलिमेंट को डिसेबल करने के लिए disabled एट्रिब्यूट का उपयोग करें। यह एट्रिब्यूट निम्न एलिमेंट्स के लिए उपयोग किया जा सकता है: <button>, <input>, <select>, <textarea>, आदि।
उदाहरण
disabled एट्रिब्यूट लागू करने का कोड:
<!DOCTYPE html>
<html>
<body>
<p>Which sports do you like?</p>
<form action="" method="get">
<input type="checkbox" name="vehicle" value="football" checked> Football<br>
<input type="checkbox" name="vehicle" value="cricket" checked> Cricket<br>
<input type="checkbox" name="vehicle" value="hockey"> Hockey<br>
<input type="submit" value="Submit" disabled>
</form>
</body>
</html>
उदाहरण में सबमिट बटन डिसेबल है। डिसेबल्ड एलिमेंट्स फॉर्म सबमिशन में शामिल नहीं होते और उपयोगकर्ता इंटरैक्ट नहीं कर सकते।