How do you prevent user input on form controls?
Sometimes, you may want to display some form controls on your web page, but prevent the user from interacting with them. For example, you may want to show a checkbox that is already checked, but not let the user uncheck it. Or you may want to show a text input that has a predefined value, but not let the user edit it. How do you achieve this in HTML? In this article, you will learn how to use the disabled and readonly attributes to control the user input on form controls.