Reputation: 23542
I have an input field I would like to clear it as soon as possible. If I put my script into the DOM is not loaded. If I use document ready the input field was already visible for some time.
With .on() I can only react to events and $(document).on('DOMNodeInserted', func)
does not include inital DOM elements.
Also I can't place the JavaScript inline only as included javascript file.
Is there any way to get the input field fast?
Upvotes: 0
Views: 92
Reputation: 1
If display: none;
is not a solution, try making text color similar to background-color of this input. And remove that rule when needed.
Upvotes: 0
Reputation: 191
In my understanding, you are talking about clearing a text field or something like that which the document will have at least 1 of that field and there is a/any event that will append similar text field to the document?
on load event and other similar event are not supported by event delegation
Upvotes: 0
Reputation: 33726
You can apply the CSS: display:none to the field.
After clear the field, remove the CSS: display:none
Hope this helps"
Upvotes: 2