0👍
✅
You can use ref
<input id="msg" type="textbox" onkeypress="onkey(event)" ref="myInput"/>
then in javascript:
console.log(this.$refs.myInput)
Source:stackexchange.com