Vue.Js get text area Value


It is very simple to get the textarea value in Vue.JS. Here in this tutorial, we are going to create one simple example to understand this.


You can get textarea value simply as below-

Example:

<!DOCTYPE html>
<html>
<head>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.js"></script>
</head>
<body>
<div id="app">
   <h1>TextArea</h1>
   <textarea v-model="myTextarea" placeholder="add multiple lines"></textarea>
	<p>TextArea Value = {{myTextarea}}</p>
</div>
<script>
 new Vue({
  el: '#app',
  data: {
    myTextarea: ['Hello World!'] 
  }
 });
</script>        
</body>
</html>

Try it »

Output of above example-


Advertisements

Add Comment

📖 Read More