I have a page with multiple web parts.

Now I'm trying to move the "add new item" button on top of a webpart after the web part title.

I did this using jQuery, using the unique web part I want, but after the migration from 2007 into 2010 some of the web part ID changed.

So eg if the web part id is 5 in SP 2010, for some old pages it may be 6.

So I tried adding both 5 and 6, but then again this is not a solution as it moves the button on other web parts.

1 Answer 1


using the id is generally a bad idea, specially if you have a common script for multiple pages

from what I see, you have three options

  • jack bauer: keep your script and fiddle around with your webparts (move them, close them, re enable them) hoping that at some point the ids will match what you need
  • nikita: embed a specific script on each page and use the ids for that page, instead of a global script (CEWP?)
  • sheldon cooper: create a proper script that looks for, perhaps .ms-wpheader and matches by titles of the webparts to do whatever
  • +1 for character answer Commented Aug 4, 2014 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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