I've been trying to figure this out for a couple hours now and can't seem to find an answer that will work or is for the version I'm using so here it is:

I am using SharePoint 2016 online I believe is what it would be. I have SharePoint designer 2013 to customize my page.

I have my AllItems.aspx* open and I am trying to customize the button that says "New Item" on a custom list to say "New person" instead. I know I have to do it with javascript (or that's the way it seems) but I cannot figure out where to put it and what exactly the javascript would be. Any help would be great. Thanks.

  • Open your Custom List via Browser.
  • Edit the Page.
  • Add Script Editor.
  • Edit Snippet.

Add the following code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>


var spans = document.getElementsByTagName("span");
for(var i=0;i<spans.length; i++) {
    if(spans[i].innerHTML == "new item") { 
        spans[i].innerHTML = "new person";  



enter image description here

  • If I have multiple views will it also change it for those? – Eric Braun Sep 13 '16 at 13:38
  • @EricBraun Yes, it will also change "new item" to "new person" for all views . you need only add the above script editor for "allitems.aspx" page – Mohamed El-Qassas MVP Sep 13 '16 at 16:19

Here is some code you could use in a Script Editor Webpart or Content Editor Webpart:

    function () {
        ExecuteOrDelayUntilScriptLoaded(function () {
            var ReRenderListView_old = ReRenderListView
                ReRenderListView = function (b, l, e) {
                ReRenderListView_old(b, l, e)
        }, "inplview.js")

function changeText(){
    var element = document.querySelector('#idHomePageNewItem span:nth-child(2)')
    element ? (element.innerHTML = "New Person") : null

This code does not require jQuery and it assumes that there is only one "New Item"-button on the page. Furthermore, this script will also change the "New Item"-text gain after you went into Quick Edit mode and back.


Using java script to change text for single web part:

<script type="text/javascript">
    var spans = document.getElementById('idHomePageNewItem').getElementsByTagName('span');
    spans[1].innerHTML="New Person";

Just note that for PowerApps, if you create a PowerApps form, this "trick" will fail. The aspx page (NewForm) is labeled the same but the classic view vs the newer view (the one that hosts the PowerApps form) does not have this script option on that view page. I'm assuming the work around for this would be to add the WebPart in the template/masterpage. Frustrating as you end up with two forms (one that you don't want because it shows all your columns - not always a desire), and the UX is dependent on the type of SharePoint view the user chooses, which you've no control over - one will say "New Item" (the one with the PowerApps form), the other will say "New Person" (assuming you added the script) on the view that has the "old fashion" view. Maybe MS could just add a variable for "New Item" and make it something we can assign values to??? As they say, "down with idiot values". HTH.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.