Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8463961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:35:46+00:00 2026-06-10T14:35:46+00:00

I have set up a little web application where you add post-its to a

  • 0

I have set up a little web application where you add post-its to a page. It’s just a project to help better learn JavaScript/jQuery and it seemed like an appropriate project (I’m new to JS/jQuery).

This is the fiddle: http://jsfiddle.net/mitchbregs/mWaPz/

I found this website: http://www.hscripts.com/scripts/JavaScript/remove-html-tag.php

I implemented the code as so:

function stripHTML(){
var re = /(<([^>]+)>)/gi;
for (i=0; i < arguments.length; i++)
arguments[i].value=arguments[i].value.replace(re, "")
}

and it still didnt work.

The problem: I need it so that when somebody inputs text into the textarea, if they input something like this “<b>Hi</b>” it would strip the “<b>” tag from the input and leave just the text.

If someone could help me out this it would be great.. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T14:35:48+00:00Added an answer on June 10, 2026 at 2:35 pm

    You have three issues: One is that the method is not returning properly (that’s the fault of whoever wrote it). Next is that you are defining the method within $(document).ready(), so it is not able to be found (at least in Chrome). Third, you are not calling it the right way (onSubmit will never be used here).

    I’ve used @Joao’s method (so you should upvote his answer) and used this method, moved outside of the ready() function:

    function stripHTML(str){
      var strippedText = $("<div/>").html(str).text();
      return strippedText;
    }​
    

    And also called it here:

    var post = stripHTML($(".text_input").val())
    

    Here is the working fiddle: http://jsfiddle.net/ee3MH/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a one page web application that manipulates a set of data:
I need a little help on this subject. I have a Web application written
im having a little issue here. I have MediaElement.js set on my project. It
I have a web application running in a kiosk, which is set up with
We're developing a data heavy modular web application stack with java but have little
Just to give a little more context to the question, I have a web
I have a visualization web application (small project) that creates charts and graphs from
I have a little web app that uses the Facebook like widget. This page
A little background: I have developed a web application in MVC3 that requires users
I have a page in my ASP.NET web application that is essentially a tool

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.