×
×
Toggle Disabled Attribute in Jquery

Toggle Disabled Attribute in Jquery
Published Dec 06,2022 by Kailash Singh
0 Comment 170 Views
In this tutorial, we are going to create an HTML input box that is Toggle Disabled and Enable by a single button in Jquery.
Step1: Create HTML
<html >
<head>
<title>ELevenstech Web Tutorials</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<div>
<input type="text" id="tt1" /><br />
<button type="button" id="btn1">Disable</button>
</div>
</body>
</html>
Step2: Create jQuery.
<script>
$(document).ready(function(){
$('#btn1').click(function(){
$('#tt1').prop('disabled', function(i, v) { return !v; });
});
});
</script>
Comments ( 0 )
SEARCH POST HERE
Support Us
Subscribe My YouTube Channel
Join Our Telegram Channel & Support Eachother
CATEGORIES
INTERVIEW QUESTIONS
PROJECT SOURCE CODE
POPULAR POSTS
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date
Copyright 2018 - 2023 Elevenstech Web Tutorials All rights reserved.