读书人

jquery css选择器“span .other” 跟

发布时间: 2012-10-11 10:16:10 作者: rapoo

jquery css选择器“span .other” 和“span.other”的区别
<!--StartFragment -->Kevin??11:07:10
<td?>
<input?type="hidden"?name="developThirds[<s:property?value='#fn.index'/>].id"?value="<s:property?value='#developThird.id'/>"/>
???
???
????<s:select?onchange="change1(this,0)"?id="dsfselect"?name="developThirds[%{#fn.index}].name"?value="#developThird.name"?list="#session.ThirdMap"></s:select>   ??
????<input?type='button'??class='button1'?value='删除'??onclick="delThisThird(this,<s:property?value='#developTache.tacheName'/>,'<s:property?value="#developThird.id"/>')"/>
????<span?class="other"??style="display:none;">?
????名称:
<input??type="text"?name="developThirds[<s:property?value='#fn.index'/>].hold1"??value="<s:property?value='#developThird.hold1'/>"/>
????</span>
??????</td>
Kevin??11:07:50
如上?onchange="change1(this,0)"
Kevin??11:08:31
如何通过select找到下面class=“other”?的span元素?
Kevin??11:08:39
用jquery
Kevin??11:09:39
change1(th,num)?方法中:

?$(th).parent().find("span?.other").css("display","block");
Kevin??11:09:57
试了不行?。。
赵福运??11:10:29
$(this).nextAll("span.other")
Kevin??11:11:07
好?我试试
Kevin??11:12:44
oh??jquery css选择器“span  .other”  跟“span.other”的区别
Kevin??11:13:03
?我这个?$(th).parent().find("span?.other").css("display","block");
怎么不行啊?

赵福运??11:13:03
find的意思是查找内部结点
Kevin??11:13:45
是啊???$(th).parent()?不是得到?td了吗?
Kevin??11:14:15
查找td下的内部节点
赵福运??11:13:57
find("span?.other")之前有个空格??
赵福运??11:14:12
去掉空格就好了
赵福运??11:14:31
"span?.other"跟"span.other"的意思是不一样的
Kevin??11:15:40
恩??好了??
Kevin??11:16:10
"span?.other"跟"span.other"的意思是不一样的?能解释下吗?jquery css选择器“span  .other”  跟“span.other”的区别

赵福运??11:17:32
“span??.other”意思是span标签下面类名是other的所有所有标签
赵福运??11:18:01
"span.other"的意思是类名是other的span标签
Kevin??11:18:44
恩??
赵福运??11:18:37
我说的“下面”是“内部”的意思
Kevin??11:19:08

返回值:Array<Element(s)>?ancestor?descendant
概述
在给定的祖先元素下匹配所有的后代元素



赵福运??11:18:50
别误解啊,呵呵
Kevin??11:19:15
呵呵额
Kevin??11:19:23
jquery css选择器“span  .other”  跟“span.other”的区别
Kevin??11:19:44
这个能解释?“span??.other”意思是span标签下面类名是other的所有所有标签
呵呵
赵福运??11:19:44

Kevin??11:20:12
"span.other"的意思是类名是other的span标签
这个在文旦里哪里有解释啊?
赵福运??11:20:05
这是CSS的后代选择器
赵福运??11:20:36
jquery的意思跟CSS一样
赵福运??11:21:01
你可以看下CSS选择器
Kevin??11:21:25
哦?
赵福运??11:21:26
jquery支持所有的CSS选择器,包括CSS3
Kevin??11:23:06
css选择器是没有空格的?
赵福运??11:23:08

赵福运??11:23:18
后代选择器就是个空格
Kevin??11:24:43
span??.other???和?span.other??都符合CSS选择器
语法的吧
赵福运??11:24:40

Kevin??11:26:02
td.fancy?{
color:?#f60;
background:?#666;
}




td??.fancy?{
color:?#f60;
background:?#666;
}
是不一样的啊?
赵福运??11:26:08
不一样
Kevin??11:26:49
哦??呵呵?明白了
Kevin??11:30:08
jquery css选择器“span  .other”  跟“span.other”的区别
Kevin??11:30:20
我怎么找不到这样的说明?
Kevin??11:30:33
后代选择器?的说明
Kevin??11:30:45
jquery css选择器“span  .other”  跟“span.other”的区别
Kevin??11:30:50
这个教程里
赵福运??11:30:55
http://www.w3school.com.cn/css/css_syntax.asp
赵福运??11:31:06
CSS?派生选择器
赵福运??11:31:25
“CSS?派生选择器”就是我说的“后代选择器”
Kevin??11:32:00
啊??我看看

读书人网 >其他相关

热点推荐