我希望當文檔完全加載時使用我的身體標記的子元素。就像我有當DOM完全加載到html中時使用元素
<body>
Country: <br>
<div>
<datalist id="country"></datalist>
<input type="text" list="country" id="search" onmouseover = 'populate("country")'/>
</div>
</body>
在input元素中,我使用onmouseover事件來調用javascript函數。但是我希望在所有元素都完全加載時啓用該功能。
到目前爲止,我在網上看到有一個負載事件,可用於身體標記調用任何特定的功能。但我不想在onload事件上調用任何函數,只是爲了確保在完全加載body時觸發input元素的onmouseover事件。
嘗試$(文件)。就緒(函數(){});函數而不是.. – Karthikeyan