javascript学习笔记--添加记录

1.获取input框内的文本


 
name email salary  
tom [email protected] 5000 delete
jery [email protected] 20000 delete



name:
email:
salary:
// 先给获取submit的ID  并通过ID 绑定单击事件
  var submit = document.getElementById("addemobutton")
  submit.onclick = function () {
    // 获取input框内的文本
    var name = document.getElementById("enpname").value
    var email = document.getElementById("enpemail").value
    var salary = document.getElementById("enpsalary").value
  }

你可能感兴趣的:(javascript学习笔记--添加记录)