I am wondering if there's any way to make this possible. I want to to check if the text value of an element begins with a certain letter.
This is my non working code:
if ($('title').text().substring(0, 1) === 'W') {
$('body').css('background', '#27aae2');
}
#elementhtml ?indexOfwould probably be easier ?document.titlegets the title as a string. No need to overuse jQuery for that.