On line 4, the statement below
$('#example-reset').on('reset', function() {
should be
$('#example-reset-form').on('reset', function() {
The example itself is correct, but the documentation code is wrong. Copying the example from the docs fails without changing the line specified.