她是我为功能编写的代码,当单击图像时,对话窗口应该加载表单输入元素。请查看下面的代码并让我知道我哪里出错了。
代码:-
<dialog id="login" style="border-color: blue; border: 1px solid">
<form name="reg">
First Name : <input type="text" name="fname" required>
Last Name: <input type="text" name="lname" required>
Email <input type="email" name="mail" required>
Password: <input type="password" name="pass" required>
Confirm Password : <input type="password" name="confpass" required>
<button type="submit"></button>
<button type="reset"></button>
</form>
</dialog>
<script>
function registration(){
var dailog = document.getElementById('login');
dailog.open();
}
</script>
最佳答案
根据MDN有 .show()
和 .showModal()
方法 - 没有 .open()
方法。
关于javascript - image onclick() 函数显示带有表单详细信息的对话框窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35257598/