Results 1 to 2 of 2

Thread: Remove HTML tags with a certain CSS class applied

  1. #1
    Join Date
    Jul 2008
    Posts
    22
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Remove HTML tags with a certain CSS class applied

    Hi,

    I have a string with lots of HTML stored in it. Within the code there are some <span> tags with the class "es" applied to them. Is is possible to remove these tags, including removing all text contained within them. Here is an example:

    Code:
    <span class="es">Useless example text</span>
    I basically want to remove all instances of these.

    Your help would be much appreciated!

    Thanks

  2. #2
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    You could use CSS to hide them:
    Code:
    .es {
        display:none;
    }
    Hope this helps...

    // X96 \\
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •