Open In App

How to make a text input non-editable using jQuery ?

An HTML document containing the input text area and the task is to make the text input non-editable with the help of jQuery. There are two approaches that are discussed below:

Approach 1: We are going to set the property readonly to true. To set the readonly property, we will use a prop() method.

Approach 2: We are going to set the property readonly to true. In this example, we will use attr() method to set the property value.


Article Tags :