Untitled
Anonymous
plain_text
06/22/2023 1:25 AM
508 B
17
Indexable
function detectDivsWithText() {
const divElements = document.querySelectorAll('div');
for (let i = 0; i < divElements.length; i++) {
const div = divElements[i];
if (div.textContent.includes('Escribe algo')) {
console.log(div);
// Do something with the matching div element
}
}
}
// Call the function to execute the code
detectDivsWithText();
Editor is loading...