【发布时间】:2017-02-11 15:12:43
【问题描述】:
如何使用 vanilla javascript 获取点击时输入的值?
function getvalue() {
console.log(this.val);
}
<input type="text" onclick="getvalue()" value="asdf"></input>
<input type="text" onclick="getvalue()" value="asdf2"></input>
<input type="text" onclick="getvalue()" value="asdf3"></input>
【问题讨论】:
标签: javascript