&"@&"代表什么?登录jQuery选择器意味着什么? [英] What does the "@" sign in jQuery selector means?

查看:39
本文介绍了&"@&"代表什么?登录jQuery选择器意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码中的 @ 标志是什么意思?

What does the @ sign in the following code means ?

$("input[@type=checkbox][@checked]").each(
    function() {
        ...
    }
);

推荐答案

这是属性选择,这在两个版本之前已停产.
如果要使选择器在当前版本上工作,则应删除 @ 符号.

This is an xpath convention for attribute selection, which was discontinued two versions ago.
You should remove the @ sign if you want the selectors to work on the current version.

或者,选择器 $("input:checkbox:checked")的作用应该相同.

Alternatively, the selector $("input:checkbox:checked") should work just the same.

这篇关于&"@&"代表什么?登录jQuery选择器意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆