I’m rendering an RSS feed and there is content at the beginning of each content section – it’s always 6 characters and I want to use jQuery to remove it.
The content of the particular bit of feed is in a list tag, so <li>blahah Hello this is where I want to display from...</li>
Getting rid of the “blahah” is the goal.
An update:
The jQuery supplied works great but I can’t work out why it’s pulling all the list elements as if they’re inline!
Would you be able to explain why the li tags in this example – jsfiddle.net/GhazG/5 run into each other when rendered, instead of appearing like this – jsfiddle.net/GhazG/6?
This will remove the first 6 characters for every
<li>element on the page. I imagine you’ll want your selector to specifically target the<li>in question.Try it out: http://jsfiddle.net/GhazG/
Since you have several
<li>elements on the page that need updating, you should do so using aneachloop:Try it out: http://jsfiddle.net/GhazG/7/
If the items are being appended to the DOM via javascript, you would also have the option of removing the characters before you do the append. It would probably be a better approach.