I need to add a class to the list item that matches document.title.
My understanding is that I need to do something along the lines of
$('.mylist li:contains(thetitle)').addClass('blah')
but contains seems to take a string rather than a variable. I am sure this is obvious, but I have wasted a stupid amount of time on it already. Thanks in advance.
You mean like this
$('.mylist li:contains(' + document.title + ')').addClass('blah')?