Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)
edited by

I want to get all images which don't have a data url. Here’s my code implementation for it:

document.querySelectorAll('img:not(img[src^="data"])');

But I get an error on my console like below:

VM701:1 Uncaught DOMException: Failed to execute 'querySelectorAll' on 'Document': 'img:not(img[src^="data"])' is not a valid selector.

Can anyone tell me how to implement jQuery :not() selector? 

1 Answer

0 votes
by (19.7k points)

You have to implement the selector like below: 

 

...img:not([src^="data"])...

 

document.querySelectorAll('img:not([src^="data"])');

You can refer to this site for further reference. 

Interested in Java? Check out this Java Certification by Intellipaat.  

 

 

Related questions

0 votes
1 answer
asked Apr 23, 2021 in Java by sheela_singh (9.5k points)
0 votes
1 answer
asked Apr 5, 2021 in Java by sheela_singh (9.5k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...