My problem is i want to do something like this:
Javascript vaja => Javascript vaja i.e i have a query string(ja
Javascript vaja => Javascript vaja
Simply use a capturing group:
"Javascript vaja".replace(/(ja)/gi, '<b>$1</b>');
Edit: Read more about capturing groups here.