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 Radio button Enable Disable on click</h3> <button @click="isDisabled = !isDisabled">Toggle Disability</button> <br> <div v-for='(option,index) in options'> <input :disabled="isDisabled" type="radio" :id="index" v-model="selectedValue" :value="option" :checked="selectedValue === 'option'">{{option}} </div> <pre>Get Selected Value: {{selectedValue}}</pre> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { options: ['HTML', 'CSS', 'Javascript', 'Vue', 'Angular', 'React', 'Node'], selectedValue: '', isDisabled: true } }, }); </script> </body> </html>