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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:29:04+00:00 2026-05-29T09:29:04+00:00

I currently have: $(‘.tweet’).text(function (_, text) { var exp = /(#(\S+))/g; return text.replace(exp, ‘<a

  • 0

I currently have:

    $('.tweet').text(function (_, text) {

        var exp = /(#(\S+))/g;

        return text.replace(exp, '<a href="http://twitter.com/#!/search/%23$2">
                                      `$1 
                                  </a>'
                           );  

    });

This create the essentially something like:

<a href="http://twitter.com/#!/search/%23data">#data </a>

but it still displays as text and not a link.

Image example:

enter image description here

  • 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-05-29T09:29:05+00:00Added an answer on May 29, 2026 at 9:29 am

    Use .html() instead of .text().

    If you use .text(), your HTML will be escaped:

    We need to be aware that this method escapes the string provided as
    necessary so that it will render correctly in HTML. To do so, it calls
    the DOM method .createTextNode(), which replaces special characters
    with their HTML entity equivalents (such as &lt; for <).

    jsFiddle Example with .html()

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

Sidebar

Related Questions

I currently have this in my document $(document).ready(function(){ $([href$='.html']).addClass('html'); $([href$='.pdf']).addClass('pdf'); }); which styles any
Currently have a database formatted as follows: id (unique id) url: http://domain.com/page.html Urls are
I currently have an xml layout called quests.xml: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent
I currently have hostingrails.com. But following their tutorial on deploying rails application with FASTCGI
Currently have this: foreach (var series in Chart1.Series) { series.Enabled = false; } I
I currently have the following script: http://jsfiddle.net/oshirowanen/mnXdv/ Which works fine, i.e. if a click
I currently have an online web hosted MySQL database with HostGator.com that currently stores
I currently have the following code: var myArray = []; var myElement = {
I currently have a textbox in my aspx: <input type=text id=myTextbox value= /> I
I currently have an MS Access application that connects to a PostgreSQL database via

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.