W
W
wiyod2018-02-27 19:03:33
JavaScript
wiyod, 2018-02-27 19:03:33

How to select all links except mailto?

This selects all links with mailto

let links = document.querySelectorAll('a[href^="mailto:"]')

And how on the contrary to select everything EXCEPT mailto?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-02-27
@wiyod

document.querySelectorAll('a:not([href^="mailto:"])')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question