国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

App下載
首頁javascripttextareaJavascript Form - 如何使用Javascript編碼HTML5的HTML實體

Javascript Form - 如何使用Javascript編碼HTML5的HTML實體

我們想知道如何使用Javascript編碼HTML5的HTML實體。

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){
    input = document.getElementById('input');
    output = document.getElementById('output');
    div = document.createElement('div');
    function update() {
        div.textContent = input.value;
        output.value = div.innerHTML;
    }
    function reverse() {
        div.innerHTML = output.value;
        input.value = div.textContent;
    }
    input.oninput = update;
    output.oninput = reverse;
    
    output.onclick = function() {
        this.select();
    }
}
</script>
</head>
<body>
  <textarea id="input" placeholder="Place your HTML here."></textarea>
  <textarea id="output" placeholder="The escaped string HTML will output here."></textarea>
</body>
</html>