Add example of enable_on_pageload.

master
voussoir 2022-11-07 17:55:15 -08:00
parent 405900cbf4
commit 7657ab79f1
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 4 additions and 0 deletions

View File

@ -389,6 +389,10 @@ function init_enable_on_pageload(element)
To create an input element which is disabled at first, and is enabled when To create an input element which is disabled at first, and is enabled when
the DOM has completed loading, give it the disabled attribute and the the DOM has completed loading, give it the disabled attribute and the
class "enable_on_pageload". class "enable_on_pageload".
For example:
<input type="text" class="enable_on_pageload" disabled/>
<button class="enable_on_pageload" disabled>Action</button>
*/ */
element.disabled = false; element.disabled = false;
element.classList.remove("enable_on_pageload"); element.classList.remove("enable_on_pageload");