Add example usage of enable_on_pageload.

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