What I want is to hide the login and register section of the html after user logs in with his account, but it doesn't seem to be working.
Here is the HTML and JavaScript code:
<div class="u lf " id="checkviewuser">
<span>
<a id="numero2" href="/RIDOApp/login.xhtml">login</a><b> | </b>
<a id="numero1" href="/RIDOApp/registraction.xhtml">register</a>
</span>
</div>
<div class="lf">
<h:outputText value="  Welcome Back, #{userBean.firstName}   " rendered="#{userBean.isLogin}" />
<p:commandLink value="logout" rendered="#{userBean.isLogin}" action="#{userBeanController.logout}" />
</div>
<script type="text/javascript">
if (('' + #{
userBean.firstName
} + 0) == 0) {
$("#yhzx").hide();
$("#checkviewuser").show();
} else {
$("#yhzx").show();
$("#checkviewuser").hide();
}
</script>