我正在尝试使用html和js从输入字段中提取文本输入。
HTML
<div class="inputarea">
<input type="text" value ='' id='myInput' placeholder="What do I need to do?">
<button onclick='todolist().submit()'>SUBMIT</button>
</div>
JS
function todolist(){
function first(){
window.open("todolist.html")
}
function submit(){
var userinput = document.getElementById('myInput').value;
console.log(userinput);
}
}
当我按下提交时,控制台显示“ Uncaught TypeError:无法读取未定义的属性'submit'”
任何帮助将不胜感激。
Sam。
尝试返回函数
可能todolist