<html>
<head>
<title>Vue.js Tutorial</title>
</head>
<body>
<h1>Difference Between v-text & v-html</h1>
<div id="wrapper">
<h2>v-text</h2>
<div v-text="myMessage"></div>
<h2>v-html</h2>
<div v-html="myMessage"></div>
</div>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
var app = new Vue({
el: "#wrapper",
data: {
myMessage: "<p style='color: red'>Welcome to my vue app.</p>"
}
});
</script>
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.