In the following code snippet:
<form>
<fieldset>
<button id="indexGetStarted" class="button" type="submit">Get Started!</button>
</fieldset>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#indexGetStarted').click(function() {
$('form').submit();
return false;
});
});
</script>
Is $(document).ready(function() { ... } necessary?
Not absolutely, since you have declared your button (and then supposedly your form) before this script is being executed, it’ll always be available. but removing that function would make your code dependent on where in the document the script block and the html elements are, in relation to one another.