Trying to change a div's ID attribute based on if the DIV's containing text matches the first word in the page TITLE
===

I have all my pages named like this: "_______ - Company Name". So far I've been able to successfully get just the first word in the page title. What I want to do next is scan a bunch of nested divs to see which one contains the same word.

basically I want to change only the css style of the div whos containing text matches the first word of that page's title.

So far I have been able to grab the first word in the page title successfully.    



    var currentPage = $(this).attr('title').toString();
    currentPage = currentPage.split(" ")[0];
    alert(currentPage);

but I cant for the life of my figure out what to do next. I want to scan a parent div, to see if any of the children divs contain "currentPage", then Ill change only the matching div's ID to something else.

Thanks for any help!