title: Select by next instance of class with jQuery
body: <p>I'm looking to convert a function that selects by id to select the next instance of a given class. </p>
  
  <p>Here is the code.</p>
  
  <pre><code>function swap3(oldDivId, newDivId) {
  var oldDiv = document.getElementById(oldDivId);
  var newDiv = document.getElementById(newDivId);
  oldDiv.style.display = "none";
  newDiv.style.display = "block";
  }
  </code></pre>