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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:48:22+00:00 2026-05-26T07:48:22+00:00

Here is my html code: <div id=notes> <table class=noborder> <tr><th class=noborder><span>notes</span></th></tr> <tr><td> <p id=notes_p>

  • 0

Here is my html code:

<div id="notes">
<table class="noborder">
   <tr><th class="noborder"><span>notes</span></th></tr>
   <tr><td>
       <p id="notes_p">

       <p>#1: dhhhhhhfdfffg
       </p>

       <p> qqqqqqqqqqwwwwwwww wweeeeeeeeerr rrrrrrrtt tttttttt  
       </p>

       <p>#2: asldkflaksdjflks, lasjdlfjsaldfjasldjfoajsdkfjaslkdjlkfasjdfwoidjfalk,zmncv,mznoqeworjoiejflaksdlfjwaf</p>
       </p>
    </td></tr>
 </table>
 </div>

What I want to do is get the text of each paragraph in the #notes_p. I have tried using…$("#notes_p").html() but I’m only getting a blank. The same with .text(). Why is that happening?

How can I get the innerHtml properly? because I want to use .wrap() in the paragraph and then also the text inside.

  • 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-26T07:48:23+00:00Added an answer on May 26, 2026 at 7:48 am

    Paragraphs don’t nest so the browser will fix your HTML by unwrapping the nesting.

    From the HTML4 specification:

    The P element represents a paragraph. It cannot contain block-level elements (including P itself).

    And from HTML5:

    Content model:
    Phrasing content.

    And phrasing content is plain character data and phrasing elements:

    a or em or strong …

    Note that <p> is not a phrasing element.

    The browser will (probably) end up with this structure in the DOM:

    <p id="notes_p"></p>
    <p>#1: dhhhhhhfdfffg</p>
    <p> qqqqqqqqqqwwwwwwww wweeeeeeeeerr rrrrrrrtt tttttttt</p>
    <p>#2: asldkflaksdjflks, lasjdlfjsaldfjasldjfoajsdkfjaslkdjlkfasjdfwoidjfalk,zmncv,mznoqeworjoiejflaksdlfjwaf</p> 
    

    and the result is that #notes_p will be empty and $('#notes_p').html() does nothing useful. You can verify this by checking your page’s structure with your favorite DOM inspector.

    Try replacing <p id="notes_p"> with a <div id="notes_p">, then things will start making sense.

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

Sidebar

Related Questions

first here is my html code: <div class=outter> <div class=item></div> <div class=item></div> <div class=item></div>
Here is the sample html code: <div id=current_element>Current element</div> Many unknown tags... <div class=target>This
Here is my HTML code <html> <body> <div>A sample block <div>and child block</div></div> </body>
I have the following html: <a href=javascript:<%# 'js code' %> class=MyClass> <div class=HeaderRow style=vertical-align:middle;text-align:left;height:35px;width:998px;>
I have the following HTML / CSS: <table> <tr> <td> <div> <pre> <code> This
not sure why I find this so difficult. Here is the html code: <tr>
Here is a part of my html code (video urls marked with a django-template
Here is an old add in to quickly comment out HTML code. Maybe I
I have this html code that i want to edit with jQuery. Here is
Here's what I'm trying to do, simplified: <input rel=TimeStart> // bunch of HTML code

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.