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
When your code runs the DOM is not ready so the element doesn't exist. Did you mean to do this instead (passing a function to jQuery is a shortcut for $(document).ready(fn)):
$(document).ready(fn)
$(function () { alert($("#testbutton").length); });