Add example usage of enable_on_pageload.

This commit is contained in:
voussoir 2022-10-29 22:19:11 -07:00
parent 415e474da5
commit e08668b28f
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
the DOM has completed loading, give it the disabled attribute and the
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.classList.remove("enable_on_pageload");