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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:49:21+00:00 2026-05-23T07:49:21+00:00

<span id=subscription-toggle class=list:subscription> &nbsp;|&nbsp; <!– I want to surround this with a div with

  • 0
<span id="subscription-toggle" class="list:subscription">

&nbsp;|&nbsp; <!-- I want to surround this with a div with a class -->

<span class="" id="subscribe-77" style="">
<a class="dim:subscription-toggle:subscribe-77:is-subscribed" href="http://localhost/taiwantalk2/topic/topic-with-two-tags-topic-with-two-tags-topic-with-two-tags/?action=bbp_subscribe&amp;topic_id=77&amp;_wpnonce=25988e5dac">Subscribe</a>
</span>

</span>

So this should be the final result:

<span id="subscription-toggle" class="list:subscription">

<div class="hide-this">&nbsp;|&nbsp;</div>

<span class="" id="subscribe-77" style="">
<a class="dim:subscription-toggle:subscribe-77:is-subscribed" href="http://localhost/taiwantalk2/topic/topic-with-two-tags-topic-with-two-tags-topic-with-two-tags/?action=bbp_subscribe&amp;topic_id=77&amp;_wpnonce=25988e5dac">Subscribe</a>
</span>

</span>
  • 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-23T07:49:22+00:00Added an answer on May 23, 2026 at 7:49 am

    If the text node you wish to wrap your div around is the only text node (i.e. it’s the only text inside subscription-toggle that is not inside another element) then you can do this:

    $("#subscription-toggle").contents().filter(function() {
        return this.nodeType == 3;
    }).wrap("<div class='hide-this'></div>");
    

    You can see an example here.

    Alternatively, if there are multiple text nodes in the span, and you only want to wrap | characters, replace the body of the filter function with this line:

    return $(this).text().indexOf("|") != -1;

    You can see an example of that one working here.

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

Sidebar

Related Questions

I have a span like this <span class='class_name'> blah blah </span> I want to
The span tag currently looks like this: <span class='best_in_place<%= ' list-downvoted' if upload.downvoted? %><%=
I have 1 span within a container div. I want the span floated to
I have span element <span class=tag onclick=clickTag(this) tagType=property> Which calls the clickTag method function
I want to select span of $(this) element, how i can do it? i
I have a span tag where I set a class to this: .some-box {
if I had a span element with some text: <span>I want this to be
The span element seems to be exactly like a div, but at the in-line
I have a span with the following style: margin: 5px 0; padding: 2px; cursor:
When a span is nested in a div with a different background there's a

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.