高手帮忙做做这个题,火线求助!!!!
如图所示,是一个选择爱好的界面,name=“list1”的是一个多选框,用Ctrl或Shift键选择多个选项,点击“确定”按钮后,会在已选项目下方以无序列表形式(name=“list2”),显示已选的项目。请根据上述说明,在空白处填写有关代码。<head><title>选择您的爱好</title></head><body><form name="frm1"><h1>请选择你的爱好</h1>
<p><select name="list1" =5 >
<option value="basketball">basketball</option>
<option value="football">football</option>
<option value="music">music</option>
<option value="reading">reading</option>
<option value="writing">writing</option></select></p>
<p><input type="button" value="确定" ="addtolist2()"/></p>
<p>已选项目:<ul id = "list2"></ul></p></form>
<script language="javascript">
function addtolist2() {
document. ("list2").innerHTML = "";
lis = "";
for(i=0;i<5;i++)
{ var option = document.frm1.list1.options[i];
if(option. ) lis += "<li>" + option.value + "</li>"; }
document. ("list2").innerHTML = ; }
</script></body>