its not the right way go go about it. The onclick event happens when you click the link.
If you have these links:
aaa | bbb | ccc | ddd | eee
and you are on page aaa and click the link to go to page bbb then when you click the link even if that changed the color of bbb the page would refresh and the color would be gone when the page loaded.
One use for onclick could be to open a different site in a separate window, ie:
window.open('https://www.jamroom.net/the-jamroom-network/forum/new_posts');return false;
would, when clicked, open this forum in a new window instead of going to the target URL. If for whatever reason that is something you wanted to do.
What you're after is a class on the LI that contains the menu. You can add one like this to the menu.tpl of site builder
<li {if $_post.module_url == $_l0.menu_url}class="active"{/if}>
thats line 2 of
/modules/jrSiteBuilder/templates/menu.tpl
so the whole thing looks like this:
{foreach $_list as $_l0}
<li {if $_post.module_url == $_l0.menu_url}class="active"{/if}>
<a href="{if $_l0.menu_url|substr:0:4 === 'http'}{$_l0.menu_url}{else}{$jamroom_url}/{$_l0.menu_url}{/if}" onclick="{$_l0.menu_onclick}" class="menu_0_link" data-topic="{$_l0.menu_url}">{$_l0.menu_title}<span class="notifications none">0</span></a>
{if is_array($_l0._children)}
<ul>
{foreach $_l0._children as $_l1}
<li>
<a href="{if $_l1.menu_url|substr:0:4 === 'http'}{$_l1.menu_url}{else}{$jamroom_url}/{$_l1.menu_url}{/if}" onclick="{$_l1.menu_onclick}" >{$_l1.menu_title}</a>
{if is_array($_l1._children)}
<ul>
{foreach $_l1._children as $_l2}
<li><a href="{if $_l2.menu_url|substr:0:4 === 'http'}{$_l2.menu_url}{else}{$jamroom_url}/{$_l2.menu_url}{/if}" onclick="{$_l2.menu_onclick}" >{$_l2.menu_title}</a></li>
{/foreach}
</ul>
{/if}
</li>
{/foreach}
</ul>
{/if}
</li>
{/foreach}
Then you will have a .active class and you can apply CSS to that class.
I'll get this added in to the Site Builder module too, because its a good idea.