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

  • Home
  • SEARCH
  • 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 6147963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:11:44+00:00 2026-05-23T19:11:44+00:00

I will first explain what I’m trying to do then I will explain why

  • 0

I will first explain what I’m trying to do then I will explain why just in case you get bored of reading the whole scenario.

Basically I have some HTML markup stored in a variable I now need to a wait to access the different elements within the variable. For example:

var markUp = "<h3>h3 tag</h3><p>paragraph tag</p>";

What I need to know is if there is a way for me to query the variable to retrieve say the h3 tag, in a similar way you would use the query function ? I have seen some other practices where people append the var to a hidden div then query the div. I would prefer to avoid this but if that is the only way I will proceed.

I have come across this problem whilst developing a drag and drop application, on drop i use a custom creator function to change the items structure once it is dropped.

If further explanation is needed please say, thanks advance Jonathan

  • 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-23T19:11:45+00:00Added an answer on May 23, 2026 at 7:11 pm

    You can use dojo._toDom to create a DOM fragment from your string.

    var markup = "<h3>h3 tag</h3><p>paragraph tag</p><p>another paragraph</p>";
    var domFragment = dojo._toDom(markup);
    
    dojo.query("p", domFragment).forEach(function(element,i) {
        console.debug(element.innerHTML);
    });
    

    The underscore prefix in _toDom means that it’s a “private” member method of dojo. Normally, it’s bad practice to use these as if they were public (like I do here). However, in the case of _toDom I believe it’s generally considered acceptable, and according to this trac entry, it sounds like it’ll be made public in the next version.

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

Sidebar

Related Questions

i have a problem with a asp.net website first i will explain the current
ok, i will explain first what i have, and what i need as result.
First I will explain the structure of my project: I have a WCF-service public
Before delving into the issue, first I will explain the situation. I have two
First I will try to explain what I want to do. The app loads
Which command will executed first,If a stored procedure have individual multiple select commands;
With :limit in query, I will get first N records. What is the easiest
I am trying to write a JavaScript function that will return its first argument(function)
I have a CSV file. The first row will always contain column headers. Depending
I have two desktop applications. After closing the first application, the first application will

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.