title: getElementById in SVG document
body: <p>I wrote a svg file like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&gt;
  
  &lt;svg width="1280pt" height="650pt" viewBox="0 0 1280 650" id="svg1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"&gt;&lt;script xlink:href="pathToPolyline.js"/&gt;&lt;script&gt;&lt;![CDATA[
  
  alert(document);//returns [object SVG document]
  
  //and tried
  
  var path=document.getElementById('path1');//the problem line
  
  alert(path);
  
  ]]&gt;&lt;/script&gt;
  &lt;path id="path1" fill="#000000" d=" M 0.00 0.00 L 1280.00 0.00 L 1280.00 449.99 C 1276.46 444.19 1270.19 441.08 1265.59 436.31 C 1264.17 429.73 1265.36 422.91 1266.42 416.36 C 1267.19 413.43 1264.94 410.65 1262.45 409.42 C 1255.44 405.63 1247.99 402.68 12 .....
  </code></pre>
  
  <p>As in the comment line <code>alert(document);</code> alerts <code>[object SVG document]</code>.</p>
  
  <p>But:</p>
  
  <pre><code>var path=document.getElementById('path1');
  alert(path);
  </code></pre>
  
  <p>alerts <code>null</code>.</p>
  
  <p>I also tried to put svg in an html page, also in an xhtml page, tried more thing but no result for now.</p>
  
  <p>Any idea?</p>