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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:36:48+00:00 2026-05-23T17:36:48+00:00

I have a little javascript app set up here: http://jsfiddle.net/faYMH/ What i want it

  • 0

I have a little javascript app set up here: http://jsfiddle.net/faYMH/

What i want it to do is add a

<div><h1>Hi there and greetings!</h1></div>

after

<div id='org_div1' onclick="addElement()">Hello</div>

using

<a href="#" onClick="addElement()" >add some</a>

(actually, what i want is for the onClick to go directly in the

So can anyone correct my code or provide some input?

(My next step is to also add a remove div, add an id to the new div with id + i++ )

Thanks so much!!

  • 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-23T17:36:48+00:00Added an answer on May 23, 2026 at 5:36 pm

    In your jsFiddle, addElement was scoped to inside the document ready handler and thus wasn’t available to the click handler. I’ve modified the settings in the jsFiddle (without changing any code) to not have your code wrapped that way and it works for me now: http://jsfiddle.net/jfriend00/XVDYa/.

    I changed the jsFiddle settings to “No-Library (pure JS)” and to “no wrap (head)”. It’s the second setting that really makes the difference here.

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

Sidebar

Related Questions

I have a little bit of Javascript that almost works correctly. Here's the code:
I have a little problem with javascript form submit issue, here is the script
I have a asp.net app that I want to disable the buttons as soon
I have a mobile app that I developed using PhoneGap (and html/css/javascript) and there
I must have a little design in javascript. I have a menu with 5
I have a really odd behavior here: I created a little popup dialog in
I have a huge web app in Javascript and its starting to become something
Im playing a little bit with heavy-client app. Imagine I have this model: class
I have a lithium app set up that way, so when return($data) is used
I have a little Facebook app, that posts some preloaded images. I changed the

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.