title: Restricting jquery to apply to elements of certain container
body: <p>I want to make a sort of try it out editor to help my students to understand jQuery better. It can be used to demonstrate and test out code. Now they will be writing code such as</p>
  
  <pre><code>$("document").ready(function(){
     $("p").css("background","red");
  });
  </code></pre>
  
  <p>Now I want that this code be applied only to the demo code which is present in the div with class jQuery-test and not to p elements outside this container. Is it possible to achieve such a thing?</p>
  
  <p>UPDATE: I guess I was not clear enough. The jQuery code has to remain the same as it is going to be submitted by the students. I want to be able to dynamically apply it only to a certain portion of a page.</p>