i'm new to html, java script and css and i'm working on a project for the U and i have a doubt. I'm making a profile page that, depenging on the type of user, it should show specific information. To do that, i used the tag div to hide data that the entity Profile should not have because it has no these atributes. In other words, i have superclass "Profile" and to sub clases "freelance" and "cliente". freelance has the atribute "cumplimiento" and "cliente" doesn't.
<div id="pfreelance" style="display: none">
<h:outputLabel for="cumplitud" value="Score:"
styleClass="control-label" />
<p:inputText autocomplete="off" id="cumplitud"
styleClass="form-control" style="margin: 0px 0px 10px 0px"
value="#{perfilPageController.profile.cumplimiento}" maxlength="50"
required="true" />
</div>
<div id="pcliente" style="display: none">
<p>you are in page of Cliente</p>
</div>
<script type="text/javascript">
var pf = document.getElementById("pfreelance");
var pc = document.getElementById("pcliente");
if ("#{perfilPageController.Bottom()}" == "c"){
pc.style.display = "inline";
}
else if ("#{perfilPageController.Bottom()}" == "f"){
pf.style.display = "inline";
}
</script>
i tried using style.display = "hidden" bt this just makes the div invisible, but doesn't stop it from loading. i know i may be making a lot of mistakes, but i want to know if there is a way to stop the div with id "pfreelance" from loading. if you have any suggestions of how i should fix my code?, i would be very grateful.