Answers for "vue div id get div information"

0

vue div id get div information

var app = new Vue({
    el:'#app',
    methods: {    
        showMyDiv() {
           console.log(this.$refs.myDiv);
        }
    }
    
   });
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<div id='app'>
   <div id="myDiv" ref="myDiv"></div>
   <button v-on:click="showMyDiv" >Show My Div</button>
</div>
Posted by: Guest on August-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language