+ Start a Discussion
Gattam Rakesh (SFDC)Gattam Rakesh (SFDC) 

How to use Java script in Visual force page

Hai all
Can any one tell me how to use java script in visual force page by using static resources 
Yoganand GadekarYoganand Gadekar
janardhan mjanardhan m
Try this simple js code.
<apex:page showHeader="false"> 
<script> function changeFont(input, textid) { 
if(input.checked) document.getElementById(textid).style.fontWeight = "bold"; else document.getElementById(textid).style.fontWeight = "normal"; } 
<apex:outputPanel layout="block"> 
<label for="checkbox">Click this box to change text font: </label>
 <input id="checkbox" type="checkbox" onclick="changeFont(this,'{!$Component.thePanel}');"/> 
 <apex:outputPanel id="thePanel" layout="block">Change me! </apex:outputPanel>

Parteek Goyal 3Parteek Goyal 3
Hi Gattam Rakesh,

You should follow these link first....http://www.salesforce.com/docs/developer/pages/Content/pages_javascript_libraries.htm

Parteek Goyal,