$(function(){ $(".proverka").html(function(index, html) { return html.replace(/\d/g, '<span>$1</span>'); }); });