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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:07:38+00:00 2026-06-16T15:07:38+00:00

Markup:: <td class=info2 gensmall> <span class=new1>In total there is <strong>1</strong> user online :: 1

  • 0

Markup::

<td class="info2 gensmall">
<span class="new1">In total there is <strong>1</strong> user online :: 1 Registered, 0 Hidden and 0 Guests </span>
 <span class="new2">We have <strong>4</strong> registered users</span>
<span class="new3">The newest registered user is <strong><a href="/u5">cldtomhil</a></strong></span>
<span class="new4">Our users have posted a total of <strong>12</strong> messages</span>
</td>

Ok guys trying to learn the jQuery .split

$(document).ready(function(){
    var a = $('td .info2 .new1');
    var b = $('td .info2 .new2');
    var c = $('td .info2 .new3');
    var d = $('td .info2 .new4');
    var w = a.split("<strong>");
    var x = b.split("<strong>");
     var y = c.split("<strong>");
     var z = d.split("<strong>");
$('.new1').html('<span>"w"</span>&nbsp;Users Online');
$('.new2').html('<span>"x"</span>&nbsp;Total Users');
$('.new3').html('<span>"y"</span>&nbsp;Newest Member');
$('.new4').html('<span>"z"</span>&nbsp;Total Messages')
    });

Ok I know I am doing this wrong just by looking at it. Though I just can’t figure out how to use the split feature, I am trying to gain the information inside the <strong> tags. Then once I have it I want to change the innerHTML basically with the new data like I posted with the .html

Yes I know it’s a lot of variables but hey what can you do, I’m not a very good coder yet, and still learning some things so.

  • 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-16T15:07:39+00:00Added an answer on June 16, 2026 at 3:07 pm

    Here is how you gain the value:

    $('td.info2 .new1 strong').text(); // returns "1"
    $('td.info2 .new3 strong').text(); // returns "cldtomhil", not "<a href="/u5">cldtomhil</a>"
    

    Etc. Having said that, String.split is a JavaScript function that splits strings given a separator. What you were trying to do was to grab the contents of an HTML element. There is no need to use string functions to do this. Use DOM functions (or jQuery) to manipulate the DOM.

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

Sidebar

Related Questions

HTML markup: <ul id=portfolio><li class=web> <span class=info>August 2007 <a href=http://awebsite.com rel=external>visit</a></span> <a href=/assets/image.jpg class=fancybox
I have this markup: <span id=tabPhp class=infoData>PHP</span> <span id=tabJquery class=infoData>jQuery</span> <span id=tabWordpress class=infoData>WordPress</span> <span
I have this markup (removed all unneccesary info) <li> <a></a> <strong class=listingAmount>1</strong> <strong class=listingPrice>10</strong>
Given a simple C# class definition like: [System.Windows.Markup.ContentProperty(PropertyOne)] public class SimpleBase { public string
Heres the markup: <div id='0203' class='threadWrapper'> <div class='littleme'> I am trying to send the
After creating a div on the fly with this markup: $('.circuit').prepend(<div class='component' draggable='true'>TRANSISTOR</div>); It
Markup: <ul> <li><a href=# class=item-list data-id=1>Link 1</a></li> <li><a href=# class=item-list data-id=2>Link 2</a></li> <li><a href=#
Given markup like this: <div class=a>A</div> <div class=b>B</div> <div class=a>A</div> <div class=b>B</div> <div class=a>A</div>
I have this markup (simplified): <ul class=targets> <li><a href=javascript:void(0); class=info>A</a></li> <li><a href=javascript:void(0); class=info>B</a></li> <li><a
In below markup i want to remove all div's with class as select <ul

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.