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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:18:15+00:00 2026-06-17T19:18:15+00:00

Sorry if this is incredibly obvious, but I have no idea why this isn’t

  • 0

Sorry if this is incredibly obvious, but I have no idea why this isn’t working.

I’m trying to create a jsFiddle. However, I don’t seem to be able to attach any of the javscript to any of the elements. For example, onclick is not calling my js function.

It doesn’t get any simpler than this fiddle. I copy-pasted it from the W3 editor where it works just fine – click the button, get alert!

<button onclick="myFunction()">Click me</button>

function myFunction() {alert("sss");}

http://jsfiddle.net/tpip/NYkQN/2/

What am I missing here??

  • 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-17T19:18:16+00:00Added an answer on June 17, 2026 at 7:18 pm

    Just change the way the JavaScript block is loaded to no wrap (head)

    enter image description here

    The standard setting here is that the JS is wrapped(!) to be run after the DOM has loaded. That means the function is not defined in global scope but inside the wrapper. Inline event handlers only work with globally defined functions though!

    When setting to no wrap (head) the JS is loaded in the <head> and is not wrapped.

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

Sidebar

Related Questions

Sorry this may be blatantly obvious but I have spent all morning trying to
I'm new to Haskell, so am sorry if this is incredibly obvious... I have
I'm really sorry. This must seem like an incredibly stupid question, but unless I
Sorry this is probably a dumb question but I have been struggling with this
Sorry this might be a very stupid question. But I did have bug with
Sorry in advance for this incredibly simple question, but what is the best way
Sorry this is my first time trying to create a plugin, so I might
I'm sorry if this question has been asked. I have looked but can not
Sorry this is basic, but I'm new to Python and Django. I have a
Hi I have this working upper menu section in Chrome/firefox and proper browsers, but

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.