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="get();" value="get" />
<input type="button" onclick="set();" value="set" />
<script>
    function get(){
        var list = document.getElementById('list');
        alert(list.outerHTML);
    }
    function set(){
        var list = document.getElementById('list');
        list.outerHTML = "<ol><li>JavaScript Core</li><li>BOM</li><li>DOM</li></ol>";
    }
</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