<html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> <textarea name="" id="" cols="30" rows="10" readOnly=true></textarea> <script src="jquery-1.9.1.js"></script> <script type="text/javascript"> $(function(){ $('textarea').on('click',function(){ $(this).attr('readOnly',false); this.focus(); }) }); </script></body></html>
If input is allowed, use css to simulate the readOnly style , remove this css when focusing
If input is allowed, use css to simulate the readOnly style, remove this css when focusing
Brother, you don’t understand what I mean