1. Create a new web part 2. In the web part, add the following code <a href="#" mce_href="#" οnclick="showTitleChanger();" id="linkChanger" style="">Change the title</a> <div id="divEditSiteTitle" style="display:none; padding:5px;" mce_style="display:none; padding:5px;"> <b>Site Title Changer</b> <input type="text" id="siteTitle" /> <br /> <input type="button" id="btnSiteTitle" οnclick="doSomething()" /> <input type="button" id="Button1" οnclick="Close()" /> </div> <!--this is the sharepoint js which integrated in SP--> <SharePoint:ScriptLink Id="showDialog" runat="Server" Name="sp.js" Localizable="false" LoadAfterUI="true" /> <mce:script type="text/javascript"><!-- var meDia; var divEditSiteTitle; function showTitleChanger() { if (divEditSiteTitle == null) divEditSiteTitle = document.getElementById("divEditSiteTitle"); if (divEditSiteTitle == null) { alert("test"); } else divEditSiteTitle.style.display = "block"; var dialog = { html: divEditSiteTitle, width: 200, height: 200 }; meDia = SP.UI.ModalDialog.showModalDialog(dialog); } function Close() { if (meDia != null) meDia.close(); } // --></mce:script> 3. deploy the webpart and add it to the page.