jQuery: Select all readonly input type textbox

In this short post, find jQuery code to select all readonly input type textboxes present on the page.
$(function(){
    $(":input[type=text][readonly='readonly']").val("");
});
However, if you have single readonly textbox element, then select it using its ID. And if you want to exclude all readonly input type textboxes from selection, then use below jQuery code.
$(function(){
    $(":input[type=text]:not([readonly='readonly'])").val("");
});
The only difference is that ":not" selector is used to exclude readonly input type elements.

Feel free to contact me for any help related to jQuery, I will gladly help you.
SHARE

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..