Remove all tags except Bold, Italic, Underline, New Lines like <br> <p>

Discussion in 'JavaScript' started by Emiko Fierros, Jul 8, 2012.

  1. #1
    hello guys, could anyone lend me a hand? You see i am trying to make a WYSIWYG editor but could do it.

    My idea is to remove all tags the trying to do a copy-paste event except for the following
    1. Bold
    2. Italic
    3. Underline
    4. New lines such as <br> <p>
    I think I saw this feature in some sites like wordpress and facebook.

    If you have some reference please do share it. Thanks!
     
    Emiko Fierros, Jul 8, 2012 IP
  2. BRUm

    BRUm Well-Known Member

    Messages:
    3,086
    Likes Received:
    61
    Best Answers:
    1
    Trophy Points:
    100
    #2
    I recommend regular expressions if you want to extract or remove parts of text.
     
    BRUm, Jul 14, 2012 IP
  3. Unni krishnan

    Unni krishnan Peon

    Messages:
    237
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    0