isContentEditable 예제
<p id="hz" contenteditable="true">홈짱닷컴 Homzzang.com</p> <button onclick="homzzang()">클릭</button> <p id="demo"></p> <script> function homzzang() { var x = document.getElementById("hz").isContentEditable; document.getElementById("demo").innerHTML = x + " = 요소내용 편집가능"; } </script> 결과보기
<p id="hz" contenteditable="true">홈짱닷컴 Homzzang.com</p>
<button onclick="homzzang()">클릭</button>
<p id="demo"></p>
<script>
function homzzang() {
var x = document.getElementById("hz").isContentEditable;
document.getElementById("demo").innerHTML = x + " = 요소내용 편집가능";
}
</script>
결과보기
결과값: true = 요소편집가능상태