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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:16:48+00:00 2026-06-18T18:16:48+00:00

Hi i have code like this: <span class=someclass style=display:none></span> Some text how to match

  • 0

Hi i have code like this:

<span class="someclass" style="display:none"></span> Some text

how to match only the “Some” word? with regExp for Javascript
10x

  • 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-18T18:16:49+00:00Added an answer on June 18, 2026 at 6:16 pm

    You’ll need to put “Some text” into a ‘div’ so you can reference it

    var str=document.getElementById("myText").innerText; 
    var patt1=/(Some)/g;
    document.write(patt1.test(str));
    

    That will return true

    Here is a working version: http://jsfiddle.net/4df3w/1/

    Change the text inside to see the difference.


    EDIT: I see you didn’t literally mean the word ‘Some‘. Put the text in a div, and in the function do this:

    var str = document.getElementById("myText").innerText; 
    var match = str.split(" ")[0];
    document.write(match);
    

    http://jsfiddle.net/4df3w/3/

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

Sidebar

Related Questions

I have HTML code like this: <asp:LinkButton ID=AddButton runat=server OnClick=AddPatientBtn_Click> <span class=Normal>Add</span> </asp:LinkButton> I
I have a HTML code like this: <div class=links nopreview><span><a class=csiAction href=/WebAccess/home.html#URL=centric://REFLECTION/INSTANCE/_CS_Data/null>Home</a></span>&nbsp;•&nbsp;<span><span><a class=csiAction href=/WebAccess/home.html#URL=centric://SITEADMIN/_CS_Site>Setup</a></span>&nbsp;•&nbsp;</span><span><a
I have some markup that looks like this: <a href=# class=someButton> <span class=play>play</span> </a>
I have code like this: <?php if(isset($global_info_results)): ?> <?php echo count($global_info_results) ?> <span>Mali Oglasi:
Having markup like this: <div class=foo> <div><span class=a1></span><a href=...>...</a></div> <div><span class=a2></span><a href=...>...</a></div> <div><span class=a1></span>some
I have some jQuery code like this: // Called right away after someone clicks
How does the Block component handle CSS classes? I have code like this: <style
I have HTML like this example: <div class=code> function something(a, b) { return 0;
I have something like this using BeautifulSoup: for line in lines: code = l.find('span',
I have code like this in my view model: function ChatListViewModel(chats) { var self

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.