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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:42:20+00:00 2026-06-11T08:42:20+00:00

I am trying to replace having to create a sub list and instead I

  • 0

I am trying to replace having to create a sub list and instead I want to add the div’s via javascript / jquery.

Here is what I have:

<script>
function makepage() {
var myvariable1="myTitle";
var newPage = $("<div>'+myvariable1+'</div");
//appendTo here?
</script>

...

Then the list:

<ul>
<li>
<a href="#" id="myid" onclick="makepage();">Click Here</a>
</li>
</ul>

The reason code creating it dynamically is that I want to pass some variables to it internally and I don’t want to use a form / post etc…

How can I make newPage appear when I click myid link?

  • 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-11T08:42:21+00:00Added an answer on June 11, 2026 at 8:42 am

    Simply make sure you use the quotes you started with and append to body or what element do you want:

    <script>
        function makepage() {
            var myvariable1="myTitle";
            var newPage = $("<div>"+myvariable1+"</div>");
            $("body").append(newPage);
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a task list with each task having a datetime
I am trying to create a Javascript template with tables and I want to
I am trying to create a super simple JavaScript templating solution. I want to
I'm trying to replace the top-level navigation of my site with images instead of
I am trying to replace a value with a passed value using javascript or
I have been trying to replace a word in a text file with a
I am trying to create a simple 3-D app for android that will have
I'm having a little trouble with this sql view. CREATE OR REPLACE VIEW view_themed_booking
I have a simple question that I am having trouble trying to find an
I have created a procedure which is working CREATE OR REPLACE PROCEDURE INIT_ACTOR_QUOTES AS

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.