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 7874953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:54:05+00:00 2026-06-03T02:54:05+00:00

Example: http://jsfiddle.net/axfsD/1/ I’m trying to strip HTML tags in my pages. I pasted below

  • 0

Example: http://jsfiddle.net/axfsD/1/

I’m trying to strip HTML tags in my pages.
I pasted below also two examples. By using replace command i can’t strip first button’s tags, but i can’t strip second one’s tags.
What can be the problem?

< script >
    $('button').replace(/<.*?>/g, "");
< /script>​

<button class="btn btn-info" rel="popover" data-content="hic   
aslinda sen de olabilir " data-original-title="Gemlik Bursa">
<small><span title="">mihan tosun</span></small></button>

<button class="btn btn-info" rel="popover" 
data-content="Benim olan benimdir Baskasinda gorduysen bil ki vazgecmisimdir   " 
data-original-title=""> <small><span title="">
Senin TAMER</span></small></button>​​​
  • 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-03T02:54:07+00:00Added an answer on June 3, 2026 at 2:54 am

    Your problem is because replace() is a native JS function, not a jQuery one. So it won’t repeat on all buttons. This is another way to do it that is more robust.

    $('button').each(function(){
        var buttonText = $(this).text();
        $(this).empty().text(buttonText);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a js fiddle of my example output: http://jsfiddle.net/Hdzv8/ and below is the
In the following example http://jsfiddle.net/xBRPg/ I'm trying to create a yellow background for one
please see this example http://jsfiddle.net/7trcV/ what I'm trying to achieve is ability to put
Please review the fiddle here for an example: http://jsfiddle.net/TKJsc/1/ Basically i'm trying to make
Example: http://jsfiddle.net/dfcyb/ I have these two vars var inview = '#' + $(#container >
Example: http://jsfiddle.net/xUrDc/ I'm trying to surround each li with a border exactly one pixel
Consider this example: http://jsfiddle.net/treeface/P8JbW/ HTML : <div id=test> <img src=http://ycombinator.com/images/y18.gif /> </div> CSS :
Example: http://jsfiddle.net/Kgn5R/ I'm trying to figure out why the inline image doesn't wind up
Code example: http://jsfiddle.net/MhEPw/1/ I have two jQuery Deferred objects. I want to have more
Live example: http://jsfiddle.net/69naX/1/ I click show, next click one, two etc, unclick etc. This

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.