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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:37:25+00:00 2026-06-14T12:37:25+00:00

How would I return Some Text , <a href=abc.html>Some Anchor</a> , and <img src=abc.jpg

  • 0

How would I return Some Text, <a href="abc.html">Some Anchor</a>, and <img src="abc.jpg" /> from the following three elements without using jQuery? In other words, how would I return $('#t1).text(), $('#t2).text(), $('#t3).text() without using jQuery? I don’t need to return an array if multiple elements as I will only select one element at a time.

<td id="t1">Some Text</td>
<td id="t2"><a href="abc.html">Some Anchor</a></td>
<td id="t3"><img src="abc.jpg" /><td>

jQuery does text() as follows. It seems overkill since I am not worried about returning an array for multiple elements.

text: function( value ) {
    return jQuery.access( this, function( value ) {
        return value === undefined ?
            jQuery.text( this ) :
            this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
    }, null, value, arguments.length );
},

Thanks

  • 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-14T12:37:27+00:00Added an answer on June 14, 2026 at 12:37 pm

    You can retrieve the text of a node(s) like so:

    var el = document.getElementById("t1");
    var text = el.textContent || el.innerText;
    

    Some more info on textContent and innerText on the MDN site here

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

Sidebar

Related Questions

I'm writing the following function to format some text from a file object 'item':
I am using elemntFromPoint in order to return onclick some element. I would like
I'm doing a $.get() request which returns some HTML. I would like to manipulate
I was wondering what the parameters from this method would return. - (void) observeValueForKeyPath:(NSString
So I am trying to loop through some elements and change some text based
I would like to extract all text from subnodes of a specific document, AND
I would like to remove some text which says text with this code: $(.jq-text
i have the t function witch return some text. so on my erb file
I would like to construct regex (in JavaScript) that would return: for string test
I want to write a function which would return me a Vector of the

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.