When it comes to editing my code, I rely on JSFiddle. However, I have noticed that in certain instances when running JavaScript or jQuery, the code only works if I choose "No wrap - <head>
" or "No wrap - <body>
".
CLICK HERE FOR THE JSFIDDLE EXAMPLE
If you check out the fiddle linked above, you'll see that clicking the <button>
element won't trigger an alert()
unless you have selected either "No wrap - <head>
" or "No wrap - <body>
".
I am naturally curious and always eager to understand how things function. Could someone explain what exactly this option changes and why it's necessary to make this change?