title: How to get the parent element value using jquery?
body: <p>I have a table with a couple of rows with two cells in each row and each cell has couple of info like office name, address and phone number etc. Using jquery for each, the address is being pulled out from each cell and fed into google map geocoder object to get the point and plot it in the map. Now at each hit of an Address value, I would also like to grab the unique value of phone and office name from the current cell from which jquery is getting address value..I need those values so i can display those values in the InfoWindow of the map? How do I get those values? </p>
  
  <pre><code>&lt;table class="OfficeInfo" border="0" style="width: 100%" cellspacing="10px" cellpadding="15px"&gt;
    &lt;tr&gt;
      &lt;td class="Office1" style="width=40%"&gt;  
       &lt;span class="OfficeName"&gt;
       &lt;div id="ctl00_PlaceHolderMain_ctl00_ctl17_label" style='display:none'&gt;Office1Link&lt;/div&gt;&lt;div id="ctl00_PlaceHolderMain_ctl00_ctl17__ControlWrapper_RichLinkField" class="ms-rtestate-field" style="display:inline" aria-labelledby="ctl00_PlaceHolderMain_ctl00_ctl17_label"&gt;&lt;div class="ms-rtestate-field"&gt;&lt;a href="/" target="_blank"&gt;St. Francis Hospital&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
       &lt;/span&gt;
       &lt;span class="Address"&gt;
       2001 86th Street West  &lt;br /&gt;Indianapolis, IN 46260        
       &lt;/span&gt; &lt;br /&gt;
       &lt;span class="Phone"&gt;
       (402) 123-1234&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
       &lt;a class="mapdirectionsLink" href="#"&gt;map &amp;#38; directions&amp;#62;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
       &lt;span class="Hours"&gt;
       MTW:9:00AM-5:00PM&lt;/span&gt;
      &lt;/td&gt;
  
      &lt;td class="Office2" style="width:40%"&gt;  
       &lt;span class="OfficeName"&gt;
       &lt;div id="ctl00_PlaceHolderMain_ctl00_ctl21_label" style='display:none'&gt;Office2Link&lt;/div&gt;&lt;div id="ctl00_PlaceHolderMain_ctl00_ctl21__ControlWrapper_RichLinkField" class="ms-rtestate-field" style="display:inline" aria-labelledby="ctl00_PlaceHolderMain_ctl00_ctl21_label"&gt;&lt;div class="ms-rtestate-field"&gt;&lt;a href="/" target="_blank"&gt;St. Margaret's Hospital&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
       &lt;/span&gt;    
       &lt;span class="Address"&gt;
       8075 North Shadeland Avenue &lt;br /&gt;Indianapolis, IN 46250&lt;/span&gt;&lt;br /&gt;
       &lt;span class="Phone"&gt;
       (316) 123-3245&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
       &lt;a class="mapdirectionsLink" href="#"&gt;map &amp;#38; directions&amp;#62;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
       &lt;span class="Hours"&gt;
       MTW:9:00AM-5:00PM&lt;/span&gt;
      &lt;/td&gt;
    &lt;/tr&gt; 
  
     &lt;tr&gt;                                   
      &lt;td class="Office3" style="border-top:1px dotted silver;  width:40%;"&gt;
       &lt;span class="OfficeName"&gt;
       &lt;div id="ctl00_PlaceHolderMain_ctl00_ctl25_label" style='display:none'&gt;Office3Link&lt;/div&gt;&lt;div id="ctl00_PlaceHolderMain_ctl00_ctl25__ControlWrapper_RichLinkField" class="ms-rtestate-field" style="display:inline" aria-labelledby="ctl00_PlaceHolderMain_ctl00_ctl25_label"&gt;&lt;div class="ms-rtestate-field"&gt;&lt;a href="/" target="_blank"&gt;Munster Women's Center&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;
       &lt;/span&gt;
       &lt;span class="Address"&gt;
       395 Westfield Road &lt;br /&gt;Noblesville, IN 46060&lt;/span&gt;&lt;br /&gt;
       &lt;span class="Phone"&gt;
       (316) 123-3245&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  
       &lt;a class="mapdirectionsLink" href="#"&gt;map &amp;#38; directions&amp;#62;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
       &lt;span class="Hours"&gt;
       MTW:9:00AM-5:00PM&lt;/span&gt;
      &lt;/td&gt;
      &lt;td  style="border-top:1px dotted silver;  width:40%"&gt;                          
      &lt;/td&gt;
    &lt;/tr&gt;               
  
   &lt;/table&gt;
  
  
            function codeAddress() {
      var infowindow = new google.maps.InfoWindow({}); 
      $('span.Address').each(function(index) {
          var addy = $(this).text();
          var off_name = $(this).siblings('.OfficeName').children(.ms-rtestate-field).text();
          var infowindow = new google.maps.InfoWindow({  content: 'Hello world'   });
  
          geocoder.geocode( { 'address': addy}, function(results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                  map.setCenter(results[0].geometry.location);
                  var marker = new google.maps.Marker({
                  map: map, 
                  position: results[0].geometry.location,
                  title:addy          
              });
  
  
              //var currentCell=(this).closest(td).html()); 
              // Adding a click event to the marker 
              google.maps.event.addListener(marker, 'click', function() { 
                  infowindow.setContent('&lt;span style="color:#808080; font-size:13px; font-family:Trebuchet"&gt;'+addy 
                             +'&lt;br&gt; &lt;a href="http://maps.google.com/maps?saddr=&amp;daddr=' + this.position.toUrlValue() + '" target ="_blank"&gt;Get Direction To Here&lt;\/a&gt;'+                      
                             off_name + '&lt;/span&gt;'); 
                  infowindow.open(map, this); 
              });  
  
  
              } else {
                  alert("Geocode was not successful for the following reason: " + status);
              }
          });
      });
  }
  </code></pre>