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
Vandana Rattan 4Vandana Rattan 4 

Visualforce page close button

Is it possible to add Close button just like aClose button on any browser window (X on top right) in Visualforce page?

Thanks,
Vandana
Rahul26Rahul26
Try this

<apex:page> 
   <apex:form>
      <apex:commandbutton onClick="window.top.close();" value="Close"  style="margin-left:95%;"/>
    </apex:form>
 </apex:page>


you can set sidebar or showheader value to False according to your requirement
David Taber 1David Taber 1
Doesn't work in Lightning, at least in Firefox.