I trying to get onclick work, but it does not... Here is my code:
HTML
Your JS is being exucuted before the DOM elements have loaded. Your event handler is therefore not being attached to the element since it doesn't exist at the time.
Wrap your JS with a DOM ready handler:
$(document).ready(function () {
$('#submit').click(function(){
alert('This onclick function forks!');
});
});
You could also just use event delegation since the document object exists at the time of execution:
$(document).on('click', '#submit', function () {
alert('This onclick function forks!');
});