
Html CSS 我想在<select><option></option></select>中添加 <span>或者<DIV>隐藏 急急急!
我想在<select><option></option></select>中添加<span>或者<DIV>隐藏对其进行传值但是隐藏时CSS失效求大神指导或者说你有能够给其...
我想在<select><option></option></select>中添加 <span>或者<DIV>隐藏 对其进行传值 但是 隐藏时 CSS 失效 求大神指导 或者说 你有能够给其传值的隐藏属性也行
展开
展开全部
这样可以不?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ss</title>
<script language="javaScript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script>
$(function(){
var sObj = $('#hehe');
sObj.change(function(){
var value = $(this).find('option:selected').val();
var name = $(this).find('option:selected').attr('name');
var text = $(this).find('option:selected').text();
alert('您选择的是:value='+value+',name='+name+',text='+text);
});
});
</script>
</head>
<body>
<center>
<select id="hehe" style="width:200px;">
<option value="a" name="AAA">标题一</option>
<option value="b" name="BBB">标题二</option>
<option value="c" name="CCC">标题三</option>
<option value="d" name="DDD">标题四</option>
</select>
</center>
</body>
</html>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |