A good example can be of a website where we have 2 kinds of users, free and pro. Pro users will have access to all the features whereas certain features will be disabled for free users.
In the following example, we have a dropdown list with 2 options, Yes and No. We will disable all radio buttons if the user selects No. Please have a look over the code example and the steps given below.
HTML & CSS
We have a few elements in the HTML file and that includes div, select, option, h1, input, and label.
The div element with a class of container is just a wrapper for the rest of the elements.
The select element has 2 options “Yes” and “No”.
We have done some basic styling using CSS and added the link to our style.css stylesheet inside the head element.