如何给select option赋值

html-css012

如何给select option赋值,第1张

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><%String path = request.getContextPath()String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><base href="<%=basePath%>"><title>My JSP 'Release.jsp' starting page</title><meta http-equiv="pragma" content="no-cache"><meta http-equiv="cache-control" content="no-cache"><meta http-equiv="expires" content="0"><meta http-equiv="keywords" content="keyword1,keyword2,keyword3"><meta http-equiv="description" content="This is my page"><!--<link rel="stylesheet" type="text/css" href="styles.css">--><script language="javascript">function change(){var arr=new Array(8)arr[0]="整车/车品"arr[1]="男装/女装"arr[2]="手机/数码"arr[3]="眼镜/手表"arr[4]="学习资料"arr[5]="运动/健身"arr[6]="箱包/帽子"arr[7]="宠物用品"var myarr=new Array(8)myarr[0]=new Array("自行车","电动车","平衡车","电滑板车","车垫","无挡摩托","有挡摩托","后备箱","修理工具","车锁","雨衣","头盔")myarr[1]=new Array("牛仔外套(女)","连衣裙","风衣(女)","毛针织衫(女)","卫衣","毛呢外套(女)","夹克(女)","牛仔裤(女)","西装(女)","牛仔外套(男)","牛仔裤(男)","夹克(男)","风衣(男)","卫衣(男)","呢大衣(男)","西装(男)")myarr[2]=new Array("iphone","华为","魅族","三星","小米","vivo","oppo","锤子","摩托罗拉","htc","乐视","努比亚","电脑","相机","相机镜头","电脑主机","ipad","ipod")myarr[3]=new Array("太阳镜","墨镜","3D眼镜","护目镜","防辐射镜","滑雪镜","潜泳镜","运动表","时尚表","男表","女表")myarr[4]=new Array("计算机","物理","化学","数学","英语","小说","名著","人文","地理","历史","机械")myarr[5]=new Array("篮球","乒乓球","网球","羽毛球","滑板","毽球","哑铃","杠铃","臂力器","卷腹轮","仰卧板","拉力绳")myarr[6]=new Array("旅行箱","储物箱","手拿包","双肩包","鸭舌帽","棒球帽","礼帽","针织帽","爵士帽")myarr[7]=new Array("水族箱","航空箱","宠物玩具","牵引带","喂水器","喂食器")var name=document.getElementById('sort')var i=0for(i<8i++){if(arr[i]==name)break}for(var j=0j<myarr[i].lengthj++){var item=new Option(myarr[i][j])document.getElementById('sort1').options.add(item)}}</script></head><style>.box{margin-top:50pxmargin-left:50pxheight:500pxwidth:500pxbackground-color:#FCFCFC}</style><body><div class="box"><p align="center"><font face="黑体" size="4">发布</font></p> 标题 <input name="biaoti" id="input1" style="width:302pxmargin-left:10px"></br></br><textarea style="margin-left:12px" rows="5" cols="35">物品描述:</textarea></br></br> 图片 <input name="upfile" style="width:302pxmargin-left:10px" type="file"/></br></br> 类别<select style="margin-left:5px" id="sort" name="sort" onchange="change()"><option selected>请选择</option><option value="整车车品">整车车品</option><option value="男装/女装">男装/女装</option><option value="手机/数码">手机/数码</option><option value="眼镜/手表">眼镜/手表</option><option value="学习资料">学习资料</option><option value="运动/健身">运动/健身</option><option value="箱包/帽">箱包/帽子</option><option value="宠物用品">宠物用品</option></select><select id="sort1" name="sort1"><option selected>请选择</option></select></div></body></html>

一个小风扇,只需要一个小马达,两节5号电池,还有一些短导线,一个实心的塑料泡沫,一把剪刀,一些硬纸片!

首先把实心泡沫掏空,用导线连接好小马达,塞入泡沫里(要保持小马达的转子轴漏出泡沫),在把导线连到电池上,也塞如泡沫内,用剪刀把小纸片剪成行,套在小马达的转子轴上即可!

洒水瓶.拿一个罐子,在尾部戳几个洞就行了.

拿一个空鸡蛋壳 外面涂上蜡(要薄薄的)

用尖的东西在上面作画 (要刻透蜡)

放进醋里几个小时 拿出来 弄掉蜡

刻过的地方的颜色被醋酸深了

就成了一件小制作了!

现在流行的晾衣架,一般都没有防风功能,使用者经常会遇到这样的烦心事:刚刚洗好的一件衣服,挂到绳子上晾晒,风一吹,落到地上,还要重新洗。我发明的自锁式防风衣钩能为大家解除烦恼。上图是自锁式防风衣架的原理图: 在上图,(1)是锁套,(2)是锁柱,它通过转轴(3)与曲柄(4)组成一个杠杆,该杠杆在配重(5)的作用下,以(3)为支点转动。晾晒衣服时,只需用手或挂钩向上托起曲柄(4),在重力作用下,锁套(1)和锁柱(2)自动分离,使用者可顺利将衣钩挂到绳上,然后松开曲柄,在配重(5)的作用下,锁柱(2)自动与锁套(1)结合在一起,完成自锁过程,与挂钩(6)形成一个锁,任凭风怎么吹,也不会自动落下。取衣架的过程也很简单:只需用手或挂物钩将曲柄(4)向上托起,锁会自动打开,使用者会很方便地取下衣架。 自锁式防风衣架不但可以用手挂到绳子上晾晒衣服,如果要将衣服挂到较高处晾晒,使用者也不需爬高,只需用挂物钩托住曲柄,就能轻松挂上或取下衣物。同时,该衣架还具有制作简单,可靠性好,成本低廉等特点。我的这个小发明已经获得了国家发明专利。

这个纸箱的面盖平时是掩盖着的,这样可以防止污物、灰尘的进入。当你要取用箱里的纸时,只要掀开箱盖,随着箱盖的掀起,箱内的纸就会自动托起,取用非常方便。用完后,一盖盖,就又恢复原位。这个自动纸箱最适用于厕所盛便纸。 纸箱的大小,可以根据自己的需要设计。中教育星多媒体教学资源库提供