• HEXUS
  • HEXUS.tv
  • channel
  • gaming
  • lifestyle
  • trust
  • community
  • ESReality
  • HEXUS.community discussion forumsVisit Corsair.com

    Welcome to the HEXUS.community discussion forums forums.

    You are currently viewing our boards as a guest which gives you limited access to view most discussions and other features. By joining our free community you will have access to post topics, respond to polls and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
    Go Back   HEXUS.community discussion forums > HEXUS.help - buying advice & technical queries > Operating systems & applications > Software and web development

    Software and web development Databases, graphics, programming, scripting and web development.

    Reply
     
    LinkBack Thread Tools
    Old 12-08-2003, 01:58 AM   #1 (permalink)
    Registered User
     
    Join Date: Jul 2003
    Posts: 11
    Thanks: 0
    Thanked 0 Times in 0 Posts
    remove HTML tags in javascript using regexp and replace

    Hi,

    i have a script i'm working on, a rich text box in DHTML which compiles the content in a hidden text field. I want to take it further to allow the number of characters to be counted, and i think the best way to do this is to take the length property of the compiled code from the hiddent text field on keypress. However this would include all the HTML tags e.g. <font face="verdana"> - so to remove these i need to convert the content of the field to a var, use a regexp to find all the <CONTENT> tags (anything within < and > ) and replace them with nothing - effectivly removing all the HTML content from the variable, and then rechecking its length. Can someone please tell me the regexp and replace command needed in javascript to remove ALL the HTML tags from a paragraph or so of HTML code

    Thank

    SP!KE
    SKILL is offline   Reply With Quote
    Old 14-08-2003, 03:32 PM   #2 (permalink)
    Goat Boy
     
    Join Date: Jul 2003
    Location: Alexandra Park, London
    Posts: 2,425
    Thanks: 0
    Thanked 0 Times in 0 Posts
    What language are you writing this in on the back end? You might be better off using an HTML parser. They exist for Java and Perl, and I'm sure there are libraries around for other languages,,,


    "All our beliefs are being challenged now, and rightfully so, they're stupid." - Bill Hicks
    DaBeeeenster is offline   Reply With Quote
    Reply

    Breadcrumb
    Go Back   HEXUS.community discussion forums > HEXUS.help - buying advice & technical queries > Operating systems & applications > Software and web development


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Trackbacks are On
    Pingbacks are On
    Refbacks are On




    All times are GMT. The time now is 10:46 AM.

    Any representations/statements made on the HEXUS.community discussion forums are the representations/statements of the author i.e. the person/organisation making them. If any such representations/statements are disputed they are a matter between the parties concerned.
    HEXUS Limited accepts no responsibility for any misrepresentations, inaccurate or false statements made by any person/organisation other than HEXUS Limited employees.
    For more information please read HEXUS Limited's terms, conditions and privacy policy.

    Hosted Exchange | Virtual Dedicated Server

    Powered by vBulletin® Version 3.8.4
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
    Content Relevant URLs by vBSEO 3.3.2
    Copyright © 2010 HEXUS® Limited. All rights reserved. Unauthorised reproduction strictly prohibited.