在jQuery 3.2.1中,调用以下表达式会返回"undefined"
(对于两者):
typeof $.expr[":"]["valid"]
typeof $.expr[":"]["invalid"]
但是,可以调用$(":valid")
或$(":invalid")
,在下面的示例中,似乎这些选择器返回具有有效值或无效值的输入。
documentation中没有提到这些选择器存在。
请查看此example以获取说明。
:valid
和:invalid
选择器的位置吗?答案 0 :(得分:3)
jQuery不包含自己的:valid
和:invalid
选择器实现。这些选择器通过浏览器通过document.querySelectorAll()
标准的本机实现在jQuery中工作。
这也意味着$(":valid")
和$(":invalid")
无法在不支持这些选择器的浏览器中运行,例如Internet Explorer 8(顺便提一下,唯一可以实现{{1}的浏览器}}和更老。
答案 1 :(得分:1)
InetAddress address = InetAddress.getLocalHost();
NetworkInterface networkInterface = NetworkInterface.getByInetAddress(address);
byte[] macAddress = networkInterface.getHardwareAddress();
StringBuilder sb = new StringBuilder();
for (int byteIndex = 0; byteIndex < macAddress.length; byteIndex++) {
sb.append(String.format("%02X", macAddress[byteIndex]));
if((byteIndex < macAddress.length - 1)){
sb.append("-");
}
}
和mouseMove : {"cmd" : "mouseMove", "data" : [100, 200]}
mousePress : {"cmd" : "mousePress", "data" : [100]}
keyPress : {"cmd" : "keyPress", "data" : [100]}
不是jquery选择器。它是一个CSS3选择器。它在CSS选择器级别3规范中定义为“有效性伪选择器”,这意味着它用于根据用户输入的评估来设置交互式元素的样式。
您可以从以下网址获得更多信息。