PA filter
Anonymous
JavaScript
01/02/2023 9:22 AM
494 B
35
No Index
Never
function removeElements(criteria, string) {
// Select all elements on the page that match the criteria
var elements = document.querySelectorAll(criteria);
// Remove each element that contains the specified string
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.includes(string)) {
elements[i].remove();
}
}
}
// Example usage: remove all elements with the class "text" that contain the string "spam"
removeElements("#resultados > div", "2.5 km");Editor is loading...