Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<ul id="list">
    <li>HTML</li>
    <li>CSS</li>
</ul>
<input type="button" onclick="inget();" value="inget" />
<input type="button" onclick="outget();" value="outget" />
<input type="button" onclick="set();" value="set" />
<script>
    function inget(){
        var list = document.getElementById('list');
        alert(list.innerText);   
    }
    function outget(){
        var list = document.getElementById('list');
        alert(list.outerText);
    }
    function set(){
        var list = document.getElementById('list');
        list.innerText = "<li>JavaScript Core</li><li>BOM</li><li>DOM</li>";
    }
</script>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers