function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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
Hi,
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"; } 
</script> 
<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>
 <apex:outputPanel id="thePanel" layout="block">Change me! </apex:outputPanel>
 </apex:page>

 
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


Thanks,
Parteek Goyal,