$1 will replace the first capture group agreed in regular expression.
There are no capture groups in your regex, so it does nothing.
You need to wrap the regex in parentheses to make it a capture.
For instance:
title = $("#task").val().replace(/([1-9])/,'<span class="int">$1</span>');
, 0; , , [0-9].
, <span>. span (, <span class="int">123</span>), +, , , :
title = $("#task").val().replace(/([0-9]+)/,'<span class="int">$1</span>');