:read-only सेलेक्टर का उद्देश्य
:read-only सेलेक्टर नॉन-एडिटेबल एलिमेंट्स को स्टाइल करने के लिए उपयोग किया जाता है, ताकि यूजर को पता चले कि यह फील्ड बदला नहीं जा सकता।
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
input:read-only {
background-color: blue;
color: white;
}
</style>
</head>
<body>
<form>
Subject: <input type="text" name="subject" value="Maths"><br>
Student: <input type="text" name="student" readonly value="Amit"><br>
</form>
</body>
</html>
यह ID 1005062664 के समान आलेख है।