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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:31:26+00:00 2026-05-14T18:31:26+00:00

I have a large Javascript codebase to convert to jQuery. The code is structured

  • 0

I have a large Javascript codebase to convert to jQuery. The code is structured such that DOM elements are created in Javascript (using a library called DomBuilder), and saved to variables if they will be needed later, before being added to the DOM.

Eg.

var inputs =
{
    submitConfirm: INPUT({type: 'button', value: 'Submit'}),
    submitCancel : INPUT({type: 'button', value: 'Cancel'})
};

document.appendChild(inputs.submitConfirm);

Then later for example…

inputs.submitCancel.style.display = 'none';
inputs.submitCancel.addEventListener('click', onClickSubmitCancel, false);

My problem is that jQuery seems to lack a way of manipulating DOM elements directly, as opposed to selecting them first (with for example $(‘#submitCancel’).

Can anyone suggest a way to directly translate the last two Javascript lines given above to use jQuery, given that the DOM elements are already available, and so do not need to be selected?

  • 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-14T18:31:26+00:00Added an answer on May 14, 2026 at 6:31 pm

    Any DOM element can be wrapped into a jQuery object very easily:

    var myObject = $(domElement)
    

    With myObject you can use jQuery methods.

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

Sidebar

Related Questions

if I have a large javascript string array that has over 10,000 elements, how
I have created a fairly large Javascript app that works in Firefox and up
I have a large image, and a bunch of divs that I'm using as
I have a large ordered list and am using jquery to add an onclick
I have a large directory structure with JavaScript, images, etc. that depend on each
I have created a sizable application javascript and jQuery. However my file structure is
I have several large Javascript files that I need to document/digg into. Unfortunately I
I have a large, dynamically generated, single page website that heavily relies on javascript.
I have a large javascript function init() that hides and shows a large number
I have a very large javascript file: it's over 9,000 lines. The code looks

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.