Get server controls in asp.net webform, and use ClientID to get server controls by js scripts
Web foreground get controls:
<%=TextBox1.ClientID %> will print out the control ID of TextBox1
Get webform control in js script: (Implementation that when the mouse moves to the control, the control color becomes red)
The code copy is as follows:
<script type="text/javascript">
function myFuntion()
{
document.getElementById('<%=TextBox1.ClientID %>').onmouseover=function(){
this.style.background='red';
}
}
</script>