HTML
<input type="text" id="note" maxlength="255" />
jQuery
$('#note').on('keyup', function () {
var currentLength = $(this).val().length
var inputLimit = $(this).attr('maxlength')
var remaining = inputLimit - currentLength
console.log(remaining)
})