var str = $(".bx_catalog_item_container").find($(".bx_catalog_item_title")).children("a").each(function(ind, elem){ var el = $(elem).text(); var indexStr = el.indexOf(":"); var changeStr = el.substring(0,indexStr); }); 
  • pancake, tried everything, through style, classList.add does not apply - lesha310392
  • $(elem).addClass("myClass"); and can find(".bx_catalog_item_title") ? - Igor
  • el.get(0).classList.add() - Darth
  • changeStr contains a set of elements and I need to apply a class to them exactly after the conversion el.substring (0, indexStr) - lesha310392
  • line contains a set of elements? Work on the wording. - Igor

1 answer 1

 $(".bx_catalog_item_container").find($(".bx_catalog_item_title")).children("a").each(function(ind, elem){ var text = $(elem).text().split(':'); text = '<b>'+text[0]+'</b>:'+text[1]; $(elem).html(text); });