-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
嵌入html代碼無法觸發事件 #30
Comments
壞了,我2年沒看Librian了,居然有issue,你貼下你的代碼看看? |
<button id = "mybtn">button</button>
<script>
let btn = document.getElementById("mybtn");
btn.onclick = function(){
alert("responsive");
}
</script> 像這樣,畫面點擊沒響應 |
看起來這應該是一個正常的行爲,在運行時插入的script是不會執行的。也許你可以試試先在js裏定義f,然後 |
這js是指的是劇本嵌入代碼的js嗎,我試了還是一樣 |
我也試了一下,看起來是onclick事件被什麼擋住了,你可以用onmousedown代替一下它…… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
劇本裏嵌入html時,像自定義的button的onclick事件不能觸發是怎麼回事,有解決辦法嗎,謝謝
The text was updated successfully, but these errors were encountered: