Answers for "javascript span containing text"

0

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');
}
Posted by: Guest on April-18-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language