I wouldn't know what to suggest about the IE7 problem without seeing the code in action. Do you have a test page I can look at?
-Mike On Sun, Nov 22, 2009 at 4:45 PM, Rua <ra2a...@gmail.com> wrote: > > Awesome thanks that works, but not in ie7? > > > Michael Geary-3 wrote: > > > > If the word "anything" is just part of the text inside the div, then it > > doesn't have a DOM element (tag) of its own. This means you can't select > > it > > with a jQuery selector or any kind of DOM manipulation, and you can't > > apply > > a CSS style to it. > > > > What you can do is rewrite the HTML content of your DIV element. > > > > If you know for sure that there is only a single DIV with > > class="tpSurveyQuestion", then it's simple: > > > > var $question = $('.tpSurveyQuestion'); > > $question.html( > > $question.html().replace( 'anything', 'anything' ) > > ); > > > > If there may be multiple DIVs that match that selector, you need to > handle > > each one individually: > > > > $('.tpSurveyQuestion').each( function() { > > var $question = $(this); > > $question.html( > > $question.html().replace( 'anything', 'anything' ) > > ); > > }); > > > > -Mike > > > > On Thu, Nov 19, 2009 at 3:18 PM, Rua <ra2a...@gmail.com> wrote: > > > >> > >> Hi I'm trying to select a specific word inside a div and would like to > >> bold > >> it, I can't seem to find how to do this anywhere! > >> > >> $(".tpSurveyQuestion:contains('anything')").css("font-weight","bold"); > >> -- > >> View this message in context: > >> > http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26421612.html > >> Sent from the jQuery General Discussion mailing list archive at > >> Nabble.com. > >> > >> > > > > > > -- > View this message in context: > http://old.nabble.com/Bolding-a-certain-word---string-manipulation--tp26421612s27240p26471202.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >