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}’);

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


Need more help?

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