How to check textbox is readonly using jQuery

Previously I had posted about "How to make textbox readonly using jQuery". One of way is to make textbox readonly is to set "readonly" attribute to true. So use the same attribute "readonly" to find out whether textbox is readonly or not using jQuery.
    $("#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);
See live Demo and Code.
Feel free to contact me for any help related to jQuery, I will gladly help you.

Nothing shocks me, I'm a Software Engineer. And I am not young enough to know everything. I live in World Wide Web and from there take care of this website. This website communicates about my work, learning and experience. I believe life is short, and it is for loving, sharing, learning and connecting. So lets connect..