Target text field:

type="text" id="target"/>

 

$("#control").toggle(

           function() {    

                     $('#target').attr("disabled", true);

           },

           function() {    

                     $('#target').removeAttr("disabled"); 

           }

);

 

Target text field:

type="text" id="target"> Disable target

 

$('#readonly').click(

           function() {    

                     if($('#readonly').attr("readonly") == true){

                                $('#readonly').val('');

                                $('#readonly').removeAttr("readonly");    

                     }

           }

);

 

[출처] http://blog.naver.com/findaday/117601025

 

http://blog.naver.com/PostView.nhn?blogId=affectionjs&logNo=140121650809

 

Posted by useways
,