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 want to make a few "special" pages in Sharepoint 2010, that hides the menu and ribbon from the Masterpage.

Is it possible to write JQuery code in a web part that can hide/disable/delete some masterpage elements?

Anyone have some tips or resources to how to achieve that?

share|improve this question
up vote 1 down vote accepted

Sure you can, almost all of the elements from the masterpages has an id and / or multiple classes that can help you identify them with jQuery.

Use the Content Editor WebPart and add your scripts in the HTML window of the webpart.

To identify the ID:s for specific elements in the DOM I recommend you to just inspect the page with the developer tools in your browser (e.g just hit F12 in IE or Chrome)

Then you could just select them with jQuery and hide them like:


but using a correct ID or Class for the element you want to hide.

Just make sure that your functions are not executed until the DOM ir ready by attaching it to the jQuery.onload like this:


or without creating the function separetely:

share|improve this answer

write javascript on page or place content editor webpart on page and linkup with your js

<script src="jquery file path" type="text/javascript"></script>
<script type="text/javascript">
// do whatever operations with any element
share|improve this answer

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.