$('#digit01').on('input', function() { $('canvas').width(this.value) }); $('#digit02').on('input', function() { $('canvas').height(this.value) });