Write a JS function that read the text inside an input field and appends the specified text to a list inside an HTML page.
Input/Output:
There will be no input/output, your program should instead modify the DOM of the given HTML document.
Sample HTML:
<h1>List of Items</h1>
<ul id="items"><li>First</li><li>Second</li></ul>
<input type="text" id="newItemText" />
<input type="button" value="Add" onclick="addItem()">
<script>
function addItem() {
// TODO: add new item to the list
}
</script>
Examples:
