How to get any apex tag runtime id on visualforce page?

Its pretty simple, just use below statement in your visualforce page:

<script type="text/javascript">

var lbl = document.getElementById(‘{!$Component.cusForm.lbl1}’);

</script>
<apex:form id="cusForm">
<apex:inputText value="{!val1}" id="lbl1" />

</apex:form>
 


Need more help?

Hi there, was your problem or query resolved? If not & need more assistance, please do reach out to us at info@nanostuffs.com, we'll be more than delighted to help. Nanostuffs has 7+ years of extensive Salesforce & iOS/Android experience.
Holler Box