JSFiddle - React, Tailwind, and code Playground

by jquerybyexample

HTML

<br/>
Readonly TextBox&nbsp;&nbsp;<input type="text" id="txtReadonly" />
<br/>
Not Readonly TextBox&nbsp;&nbsp;<input type="text" id="txtNotReadonly" />

JavaScript

$(document).ready(function(){
    $("#txtReadonly").attr('readonly', true);
    var isReadonly = $("#txtReadonly").attr('readonly');
    alert('txtReadonly is not readonly ' +isReadonly);
    var isNotReadonly = $("#txtNotReadonly").attr('readonly');
    alert('txtNotReadonly is not readonly ' + isNotReadonly);
});