<input type="text" name="info"> <button>发送</button> <ul></ul>
var input = document.getElementsByName('info')[0] var bt = document.getElementsByTagName('button')[0] var ul = document.getElementsByTagName('ul')[0] bt.onclick = function(){ var value = input.value var li = document.createElement('li') li.innerHTML = value ul.appendChild(li) input.value = '' }