title: How to access Raphael fill image in VML
body: <p>I want to access VML element which stores fill image in VML. I pasted my demo code below. Notice that it will only work when you include <a href="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.js" rel="nofollow">raphael.js</a> and <a href="http://code.jquery.com/jquery-1.9.0.min.js" rel="nofollow">jquery.js</a>.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;Raphael Test&lt;/title&gt;
  
          &lt;script type="text/javascript" src="js/libs/jquery.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="js/libs/raphael.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function() {
  
                  var raphael, path, pattern;
  
                  raphael = Raphael(document.getElementById('raphael'), 500, 500);
  
                  path = raphael.circle(100, 100, 80);
                  path.attr('stroke-width', 3);
                  path.attr('fill', 'url(http://3.bp.blogspot.com/_M4WdA9j-b-g/TLMF9JJJwcI/AAAAAAAAAV4/p0Y_Wo3S3sQ/s1600/Landscape1.jpg)');
                  pattern = $(path.node).attr('fill');
                  if(pattern) {
                      pattern = pattern.replace('url(', '').replace(')', '');
                      pattern = $(pattern);
                  }
  
                  // Shape element documentation: http://msdn.microsoft.com/en-us/library/hh846327(v=vs.85).aspx#shape_element
                  // Fill element documentation: http://msdn.microsoft.com/en-us/library/bb229596(v=vs.85).aspx
  
                  if(Raphael.vml) { // SVG not supported (IE7 &amp; IE8) and it doesn't work :/
                      console.log($(path.node).find('fill').attr('href'));
                  }
                  else { // SVG supported and it prints correct URL
                      console.log($(pattern).find('image').attr('href'));
                  }
              });
          &lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="raphael"&gt;&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>In SVG fill image is provided using pattern element. That's why I'm fetching this element, and I can easily access its href attribute.</p>
  
  <p>VML is pretty different. Path is created with shape element, which have fill element inside. But unfortunately fill element doesn't have any attributes:/</p>
  
  <p>Can someone help me to access VML fill image element?</p>