I have a web form containing usercontrol and I would like to have access to the html elements in usercontrol from the form page using javascript.
I tried the following:
document.getElementById('<%= usercontrol.clientid %>')
but it returned null.
I looked around with firebug and found that tags in usercontrol are rendered using clients like usercontrolid_myelement. I assume something like this might work:
document.getElementById('<%= usercontrol.clientid %>'+'_myelement')
Is there a better way to do this?
source
share