// Disable #x
$( "#x" ).prop( "disabled", true );
// Enable #x
$( "#x" ).prop( "disabled", false );
atau
//HTML
<input type="text" name="tahun_anggaran" class="form-control pull-right text-center inputan" value="2016" readonly="readonly">
<a class="btn btn-info col-md-12 pull-right" id="buka"><i class="fa fa-lock"></i> Buka Tahun</a>
<a class="btn btn-danger col-md-12 pull-right" disabled=""><i class="fa fa-lock"></i> Kunci Akun</a>
<a href="#" class="btn btn-success tombol_tombol" disabled=""><i class="fa fa-plus"></i></a>
//JavaScript <script type="text/javascript">
$(document).ready(function () {
$('#buka').on('click', function () {
$('#buka').attr("disabled", "disabled");
$('#kunci').removeAttr("disabled");
$('.tombol_tombol').removeAttr("disabled");
$('.inputan').removeAttr("readonly");
});
$('#kunci').on('click', function () {
$('#kunci').attr("disabled", "disabled");
$('#buka').removeAttr("disabled");
$('.tombol_tombol').attr("disabled", "disabled");
$('.inputan').attr("readonly", "readonly");
});
});
</script>
Sekian, terimakasih atas kunjungannya.
Salam,
PHP Aku : Membangun web terorganisasi dan mudah dimengerti, contoh tutorial dengan menggunakan HTML, CSS, JavaScript, SQL, PHP, dan XML.
EmoticonEmoticon