이 코드는 데스크톱 브라우저에서 제대로 작동하지만 iOS (iPhone 5/iOS 7)에서는 잘 작동하지 않습니다. 클릭 한 입력 외부를 클릭하면 클릭 한 입력이 readonly-> true가되지 않습니다. 업데이트 된 코드 : 읽기 전용 속성을 추가iOS에서 jQuery 코드가 작동하지 않습니다.
<script>
$(document).ready(function() {
$("input").prop("readonly", true);
$('input').bind('click', function() {
$(this).prop("readonly", false);
});
$('input').bind('blur', function() {
$(this).prop("readonly", true);
});
});
</script>
사용해보기 http://jsfiddle.net/cse_tushar/HxgXA/ –
@TusharGupta @TusharGupta 코드도 작동하지만 데스크탑 브라우저에만 해당 - iOS = 변경 없음 - 작동하지 않음 – Mike
내부에서 $ (function() {}) 사용 ; –