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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:14:40+00:00 2026-06-11T10:14:40+00:00

html = ‘<h1>foo</h1><p>bar</p>’; virtual_dom = $(html); console.log(virtual_dom); // logs a data structure recognizable as

  • 0
html = '<h1>foo</h1><p>bar</p>';
virtual_dom = $(html);
console.log(virtual_dom);
// logs a data structure recognizable as a DOM with the h1 and p from the string

Does jQuery provide a way to remove paragraphs from virtual_dom, such that console.log(virtual_dom) will log a DOM with only a h1 tag, like $('p').remove() but affecting virtual_dom instead of the actual document rendered by the browser?

  • 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-11T10:14:42+00:00Added an answer on June 11, 2026 at 10:14 am

    Use .filter(), for example:

    virtual_dom = $(html).filter(":not(p)");
    

    This will exclude all paragraphs from your html.

    DEMO.

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

Sidebar

Related Questions

html <div class=btn-group data-toggle=buttons-checkbox> <label class=btn for=id_bar> <input type=checkbox name=bar value=1 id=id_bar /> Bar
HTML <form enctype=multipart/form-data id=SubmitForm method=post action=serv.php> <input type=file name=IMG size=chars> <input type=Submit value=SAVE> </form>
html img returned from ajax has class of 'tocrop'. Currently I Calling the function
html structure: <form method=post id=comment-form accept-charset=UTF-8> <div class=form-item form-type-textfield form-item-name> <input type=text id=edit-name name=name
HTML: <div class=chocs>Chocolate Bar <div class=id>1234</div></div> jQuery: $('div#groupinfo .chocs').click(function(){ alert($(this).slug.text()); }); Im trying to
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
html code <div style=width: 1000px;margin: auto class=cf> <div class=bo data-href=../../link1>click</div> <div class=bo data-href=../../link2>click 2</div>
HTML: <div class=promo_tumbs col_12> <div data-dir=prev class=prev></div> <div data-dir=next class=next></div> <div class=promo_tumbs_centar> <a href=#first><div
HTML part: <a href=# onclick=callme();return false;>foo</a> JS part: function callme() { var me =

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.