Css:- read-only-and-read write


The :read-only selector selects elements which are "readonly".
In most browsers, the :read-only selector only applies to input and textarea elements, but it should be applied to all elements which are "readonly".
The :read-write selector selects form elements which are "readable" and "writeable".
The :read-write selector only applies to input and textarea elements, where the "readonly" attribute is not present, regardless if the element is disabled or not.



Code:-


<!DOCTYPE html> 
<html> 
 
<head> 
 <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
 <style> 
  input:read-only { 
   background: brown; 
  } 
   
  input:read-write { 
   background: blue; 
  } 
  /*For Firefox*/ 
   
  input:-moz-read-only { 
   background: brown; 
  } 
   
  input:-moz-read-write { 
   background: blue; 
  } 
 </style> 
 
</head> 
 
<body> 
 
 <input type="text" value="Read only text box" readonly> 
 <input type="text" value="Read write text box"> 
 
</body> 
 
</html>



Css:- read-only-and-read write Css:- read-only-and-read write Reviewed by Network security on May 12, 2019 Rating: 5

No comments:

Useful Information

Powered by Blogger.