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

H

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>
 

About the author

Nishant Bamb
By Nishant Bamb

Category