title: javascript looping through 2d array
body: <p>I am trying to work through how to publish items from multiple arrays while first searching through the separate array elements and then return only those items which match a certain criteria. The following code does not do this yet.</p>
  
  <pre><code>enter code here&lt;div id="myDiv"&gt;
  &lt;script type="text/javascript"&gt;
  
  
  var $ = function(id) {
      return document.getElementBuId(id);
  
  }
  var title = new Array("Barbecuing in the Rain","Picnicing in the Arctic",
          "How to Saute on a Radiator", "A Real Grasshopper: Bartending with Insects",
          "Food with a Bullet:  Cooking in Camden", "Mirepoix for Dummies");
  var price = new Array(18.50, 23.95, 41.95, 5.95, 13.00, 99.00);
  var binding = new Array("Hardcover", "Paperback", "Hardcover", "Paperback", "Paperback", "Hardcover");
  var pubYear = new Array(2002, 1975, 2004, 2006, 2001, 1997);
  var NYTBestSeller = new Array(true, true, false, false, true, true)
      var seriesTitle = new Array("Food Network", "The Food Network", 
              "Culinary Shortcuts", "Sunset Libations", 
              "Food Network", "The Food Network");
  var bargainBooks = ("Food Network Hot Selling Bargain Book");
  
  for (i in title) {
      if (((price[i] &lt;= 25 &amp;&amp; binding[i] == "Hardcover") || 
                  (price[i] &lt;= 15 &amp;&amp; binding[i] == "Softcover")) &amp;&amp; (pubYear[i] &gt;= 2000) &amp;&amp; 
              (NYTBestSeller[i] == true) &amp;&amp; (seriesTitle[i] == "Food Network") || (seriesTitle[i] == "The Food Network"))
  
  
          //document.write("&lt;span color='red'&gt;This line is red&lt;/span&gt;");
  
  
  
          document.write(title[i] + "&lt;br /&gt;");
      document.write(price[i] + "&lt;br /&gt;");
      document.write(binding[i] + "&lt;br /&gt;");
      document.write(pubYear[i] + "&lt;br /&gt;");
      document.write(NYTBestSeller[i] + "&lt;br /&gt;");
      document.write(seriesTitle[i] + "&lt;br /&gt;" + "&lt;hr/&gt;");
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I am searching for books that met a certain criteria and then trying to output where that book is on the page a message of Hot Selling Book in green. But I can't figure out how to make the document.write work. document.write().style.color="green" does not work.</p>