Use .slice(start, end)
with start and end values:
var str = 'cat1234';
document.body.innerHTML = str.slice(0, 3);
With javascript you can use a regular expression with .match()
method to exclude the number and get the string value.
var str ='cat1234',
rg = /[a-zA-Z]+/g,
ns = str.match(rg);
document.body.innerHTML = ns[0];