Answers for "vue js get id of element"

0

vue get element by id

<!-- In template -->
<div id="myDiv" ref="myDiv">This is a div</div>

<!-- In script, inside a function or wherever you need it -->
<script>
	myDiv = this.$refs.myDiv
</script>
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language