[JQuery]几个易混淆概念的总结

1.[display:none 与 visibility:hidden 的区别]

display:none means that the tag in question will not appear on the page at all (although you can still interact with it through the DOM). There will be no space allocated for it between the other tags.

display:none 表示设置此属性的标签元素在页面中不会出现,并且此元素并不会在其他元素之间占位。

visibility:hidden means that unlike display:none, the tag is not visible, but space is allocated for it on the page. The tag is rendered, it just isn't seen on the page.

visibility:hidden和前者不同的地方在于,设置此属性的标签元素不可见,但是会在页面中展位,并且该元素也会被css样式所修饰,只是不可见而已。

input[type=hidden] :HIDDEN is a TYPE attribute value to the INPUT element for FORMs. It indicates a form field that does not appear visibly in the document and that the user does not interact with. It can be used to transmit state information about the client or server.

[Notice]在JQuery中由可见性过滤器找到的元素包括:display为none的元素、隐藏的文本区域(type="hidden")以及visibility:hidden的元素

2.[ $('input') 与 $(':input')的区别]

$('input') = with only the element name, selects only HTML elements.

$(':input') = with the colon, selects/filter all form input type elements, including inputselect textarea , and button elements.

3.[$(‘element:hidden’) 与$('element :hidden') 的区别]

可见性过滤选择器与子代选择器的区别
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值