screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </head> <body> <div id="app"> <h3>Vue Js input type number min max validation</h3> <label for="quantity">Quantity:</label> <input type="number" id="quantity" name="quantity" v-model.number="quantity" min="1" max="10"> <p v-if="quantity < 1 || quantity > 10">Quantity must be between 1 and 10.</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { quantity: 1, }; }, }); </script> <style scoped> #app { display: flex; flex-direction: column; align-items: center; } label { font-weight: bold; } input { margin-bottom: 10px; padding: 5px; border: 1px solid #ccc; border-radius: 3px; } p { color: red; font-size: 14px; font-style: italic; } </style> </body> </html>