Include Javascript and CSS in Visualforce

Include Javascript and CSS in Visualforce

Javascript codes must be wrapped inside the tags <Script> </Script> in a Visualforce Page.

CSS codes must be within <Style>  </Style>

<apex:page >
    <script>
       function myfunc(){
         alert("hi");
       }
    </script>    
    <style>
        h1 {
           color: blue;
         }
    </style>
    
    <h1> My Sample Page!</h1>
</apex:page>

Related posts

Leave a Comment