Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript span containing text

const box = document.getElementById('box');

if (box.textContent.includes('five')) {
  console.log('✅ five is contained in span');
} else {
  console.log('⛔️ five is NOT contained in span');
}
 
PREVIOUS NEXT
Tagged: #javascript #span #text
ADD COMMENT
Topic
Name
4+8 =