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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:54:01+00:00 2026-06-13T14:54:01+00:00

I am not familiar with the below syntax. What is the purpose of adding

  • 0

I am not familiar with the below syntax. What is the purpose of adding the object?

selectIt = $('<div />', {text : $this.attr('title')});
  • 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-13T14:54:02+00:00Added an answer on June 13, 2026 at 2:54 pm

    The code in your question body creates a div node, settings text (i.e. its inner HTML) to the value of $this.attr('title'). The div node will be assigned to the selectIt variable, but is not yet appended to any part of the DOM.

    The code in your question title is also valid, except for the unclosed string. It selects the element with the id myID, searching only within the DOM node obj. Passing a context node is superfluous when selecting by ID, seeing as ID’s are unique in the document, and selecting by ID is quick enough, but for other elements, it can be a useful way to add precision, and not have to search the entire document.

    Note the difference between passing a bit of HTML, which will instruct jQuery to create the matching node tree, so that you may append it to the DOM, or passing a selector, which will instruct jQuery to find the matching nodes within the current DOM.

    $('<div />') // create a div
    $('div') // find a div
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This must be something very basic. I'm not familiar with the syntax, and this
Given the code below, what does the with keyword do? I'm not very familiar
I've come across some syntax I'm not familiar with and am unable to find
Really basic (and probably quite idiotic) question but I'm not familiar with this procedure
I've already implemented this, but as I'm not familiar with the FOR loop statement
I am not familiar with this website but I am desperately seeking help with
The code below obviously won't work. I am not familiar with how to return
For anyone not familiar with Web API and serializing dates to JSON, here's what
I'm not familiar with beautifulsoup's encoding. when I tackle with some pages,some attribute is
I'm not familiar with Capistrano at all, I've just read some basic posts about

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.