![](/img/trans.png)
[英]Regex doesn't work. What's wrong with my code? Can anyone help me fix this
[英]Can anyone please help me what I did wrong on my EventHandler for some reason I can't open the Display Conformation box?
這是代碼:
<form NAME = "winform">
<p>
<input TYPE = "button" VALUE = "Display An Alert"
onClick = "window.alert('This is a test alert');">
</p>
<p>
<input TYPE = "button" VALUE = "Display a confirmation"
onClick "temp = window.confirm = ('Would you like to confirm?'); window.status = (temp)? 'confirm:true' : 'confirm:false';">
</p>
<p>
<input TYPE = "button" VALUE = "Display a prompt"
onClick="var temp = window.prompt('Enter some text:','This is the default value'); window.status=temp;">
</p>
除了這個之外,我收到了警報和提示。 我嘗試使用Chrome和IE與他們愚蠢的開發人員關閉他們幾乎無法判斷我是否正確地完成了我的技能所以現在我在這里請求幫助我是否已經正確完成了。
那么你的HTML看起來真的很糟糕...但我認為問題在於onclick:
onClick "temp = window.confirm = ('Would you like to confirm?'); window.status = (temp)? 'confirm:true' : 'confirm:false';"
需要是這樣的:
onClick="temp = window.confirm('Would you like to confirm?'); window.status = (temp)? 'confirm:true' : 'confirm:false';"
還要確保temp
在正確的范圍內聲明(使用var temp
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.