javascript - How can I re-enable a text field? -
i trying re-enable text field gets automatically filled in , disabled on website use ticketing. possible inspect element, , enable manually field enter want. i'd remove step. trying make (very) simple chrome extension detect when field has been disabled , switch on, i'm having no luck.
i've tried several iterations, no success. here's i've got @ moment.
var subject = document.getelementbyid('title_fs'); subject.onchange = function() {fix()} function fix(){ subject.setattribute("enabled", true)}
i tried
var subject = document.getelementbyid('title_fs'); subject.addeventlistener("change", {subject.setattribute("disabled", false)});
the success i've had far accidentally disabling field page loaded. suggestions?
simply remove attribute
document.getelementbyid('title_fs').removeattribute('disabled');
document.getelementbyid('removedisabled').addeventlistener('click', function() { document.getelementbyid('title_fs').removeattribute('disabled'); });
<textarea disabled="true" id="title_fs">foobar</textarea> <button id="removedisabled">remove disabled</button>
Comments
Post a Comment