SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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
share|improve this answer
+1 for character answer – Robert Lindgren Aug 4 '14 at 18:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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