create function render category in js