JSFiddle - React, Tailwind, and code Playground
HTML
<input id="dropUnit" type="text" />
<input id="dropUnit1" readonly type="text" />
JavaScript
alert($('#dropUnit').attr('readonly') == "readonly");
alert($('#dropUnit1').attr('readonly') == "readonly");