jQuery is not finding any elements. alert($(\"#testbutton\").length); displays 0 every time.
alert($(\"#testbutton\").length);
Am I doing something wrong?
My JS / jQuery cod
If you write jQuery script in the head using:
(function() { ... })();
it doesn't work because it may execute the script before loading the content of the body page.
Use:
$(document).ready(function() { ... });
or move your script at the footer.