Add example usage of enable_on_pageload.

This commit is contained in:
voussoir 2022-10-29 22:19:04 -07:00
parent bec695aec4
commit bbacbd952b
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

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");