U can refer each componet is identified in its Id in JSF
but to identify a component on the generated html code the component is prefixed with parent id also
suppose
<h:form id="one">
<h:inputText id="text"/>
</h:form>
to identify inputText in javascript it should accessed by
document.getElementById("one:text");
if no id is given to form and components then default things are used
document.getElementById("_id0:_id0");