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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:58:09+00:00 2026-06-13T22:58:09+00:00

I want to access the element from a HTML string using JQuery. I have

  • 0

I want to access the element from a HTML string using JQuery.

I have a following AJAX function which returns HTML text on success. I wish to extract only the contents of the tag from that HTML text using Jquery.

suppose i have a variable resp containing HTML content. I want to access the contents of the tag inside this HTML content as below..

var resp = "<html><head></head><body><form action="changePassword" name="fmChangePassword"> .... form elements .... </form></body> </html>"
alert(resp); //this alerts the full HTML content properly                 
alert($(resp).find("form").html()); //trial 1 -- returns NULL
var test = $(resp).find("#changePassword"); //#changePassword is the ID of the form
//alert(test.html());
displayChangePwdWindow(test);   //need to pass the form content here        

I tried using .find() but no success.

Can anyone help me how to do this?

  • 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-13T22:58:10+00:00Added an answer on June 13, 2026 at 10:58 pm

    may be this can help you

    $.ajax({
       type: "POST",
       url: url,
       error: function(jqXHR, textStatus, errorThrown) {
          alert(errorThrown);
       },
       success: function(resp){
          var test = jQuery("<div/>").append(resp).find("#changePassword");
          alert(test.html());
          displayChangePwdWindow(test);  //need to pass the form content here    
       }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to access an html element's prototype through jQuery's .data() function. So
I have two frames and want to access an element in one frame from
Using Ember.CollectionView I want to access and manipulate the DOM element which is being
I have an html element that I want to hide from view, but I
I have a non-fixed dimensional matrix M, from which I want to access a
I want to access the text elements inside this textbox in GWT from the
I have a problem in passing one of html element to jQuery. I know
Can we access an element of a content page from master page using JavaScript?
I have a basic jQuery question. I get an jquery object from a string:
I want access a STL based container read-only from parallel running threads. Without using

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.