I have used custom div for share icon.When admin login to the site the share icon will be shown.and other user login to the site the share icon will be hidden.how can I do this?
You can use
SharePoint Security Trimmed Control as mentioned at Hide SharePoint 2013 Ribbon based on Permissions
Also, you can use a
SPServices to hide DIV with its ID if the current user belongs to a specific group as the following:
For more details, Please check Show / Hide a Div based on a user group in SharePoint via SPServices
Also, you can use SharePoint Security Control
The proper solution will depend on where you put the DIV tag (e.g. Masterpage (HTML vs. .NET), Page Content, Content Editor Web Part).
You should look into the SPSecurityTrimmedControl. Here are some links that will help you: