-1

i want to make a user script that changes the max value of a input form

<div>
      <label>Time limit (in minutes, max 120)</label>
      <input type="number" name="max_time" value="60" min="1" max="120" required="">
    </div>

the value im after is 120 and the userscript should only be able to modify that value

the question When to use setAttribute vs .attribute= in JavaScript? is not useful here since my question is about modifying html with user scripts

  • Here is an example of what you can try ```const input = document.querySelector('input[name="max_time"]'); if (input) { input.max = '200'; }``` – erosman Jun 04 '22 at 17:09

0 Answers0