I have this input which I need to set to readonly
using jquery. Below is what I've done so far, but the code is not working. What is my mistake here?
HTML:
<input type="text" placeholder="" data-field-id="field26" name="field26[]" data-min-char="" data-max-char="" data-val-type="url" data-regexp="" data-is-required="false" data-allow-spaces="" class="validation-lenient" data-placement="right" data-toggle="tooltip" tooltip="" data-trigger="focus" data-html="true" data-input-mask="" data-mask-placeholder="">
js:
$( document ).ready(function() {
input('[data-field-id="field26"]').setAttribute("readonly", true);
$('[data-field-id="field26"]').setAttribute("readonly", true);
});