VISUALFORCE and JS CODE:
onclick=”changeFont(this,'{!$Component.thePanel}’);”/>
Note:
‘{!$Component.idName}‘ : This is the way of passing particular visualforce component id into the javascript.
3x Salesforce MVP | Platform Champion | 18x Salesforce Certified | MuleSoft Certified | 8x Trailhead Ranger | TechForce Services | Sydney | Australia