Step 1:
Firstly, create Empty Project in visual studio
Step 2:
Then add new item and create empty Element
In Element.xml file add the following code:
<?xml version="1.0" encoding="utf-8"?>
<Elements
xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Location="ScriptLink"
ScriptSrc="/_layouts/CustomRibbonButton/JavaScript1.js"/>
<CustomAction
Id="DemoHelloWorldButton1"
RegistrationType="List"
RegistrationId="101"
Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.Documents.Manage.Controls._children">
<Button
Id="Ribbon.Documents.Manage.Controls.DemoHelloWorldButton"
Alt="Hello World Ribbon Button"
Sequence="10"
Image32by32="http://test/MyPicturestest/test.png"
Command="Demo_HelloWorld"
LabelText="WhatsApp12"
TemplateAlias="o1"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="Demo_HelloWorld"
CommandAction="javascript:xyz();" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
For Javascript1 file write any javascript code. This file will call Alert.
Alert("welcome");
