javascript querySelector 无法与“:not()”选项一起使用
javascript querySelector not working with with ':not()' option
您好,这个选择器有问题
document.querySelectorAll('img:not(img[src^="data"])');
我需要获取所有没有数据的图像 url,
我的开发者控制台说
VM701:1 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'img:not(img[src^="data"])' is not a valid selector.
应该就是...img:not([src^="data"])...
document.querySelectorAll('img:not([src^="data"])');
详细了解 attribute
选择器 here
您好,这个选择器有问题
document.querySelectorAll('img:not(img[src^="data"])');
我需要获取所有没有数据的图像 url,
我的开发者控制台说
VM701:1 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'img:not(img[src^="data"])' is not a valid selector.
应该就是...img:not([src^="data"])...
document.querySelectorAll('img:not([src^="data"])');
详细了解 attribute
选择器 here