The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Wrap around specific word with jQuery

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #37383

    I thought this would be easy but I am having trouble getting it, this is my HTML:

    Sat Mar 31 2012

    Unfortunately, I don’t have any control over this output, this is just the way it is. I want to wrap a around the date specifically so that I can style it with CSS, what would be the best way to do that? Please note, the date will change anywhere from the 1-31 so maybe all the dates would have to be in an array?

    Thank you in advance for your help.


    Is the date already wrapped in an H2? Or are you sharing the desired result?

    Could you please share a bit more HTML. It might be possible to use the HTML around the date to target it specifically or at least focus in on it. I’m thinking a replace regex would work, so you wouldn’t need an array of all dates.


    How is the date being generated?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.