title: Getting data in url printing in html page
body: <p>i am getting data through Url then split and displayed in java script but i am not able to print in html page please help me</p>
  
  <h2>Page 1</h2>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
      function setURL() {
          var dt_value = document.getElementById("dt_id").value;
          //just test here ..what is coming..
          alert( dt_value );
          var sjdurl =  "page2.html?Name=" + dt_value;
          popup = window.open(sjdurl);
          popup.window.moveTo(950,150); 
  
      }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div style="text-align:left; margin:8px 5px auto;"&gt;
         &lt;label for="dt_id"&gt;Please enter a date and time &lt;/label&gt;
         &lt;input type="Text" id="dt_id" maxlength="25" size="25"/&gt;
         &lt;input type='button' onclick='setURL()' value='SUBMIT'&gt;     
      &lt;/div&gt;
   &lt;/body&gt;
   &lt;/html&gt;
  </code></pre>
  
  <h2>page2</h2>
  
  <pre><code> &lt;html&gt;
   &lt;head&gt;
   &lt;script LANGUAGE="JavaScript"&gt;
       window.onload=getParams
       function getParams() {
           var idx = document.URL.indexOf('?');
           var params = new Array();
           if ( idx != -1 ) {
               var pairs = document.URL.substring(idx+1, document.URL.length).split('&amp;');
               for ( var i = 0; i &lt; pairs.length; i++ ) {
                   nameVal = pairs[i].split('=');
                   params[nameVal[0]] = nameVal[1];
               }
           }
           return params;
       }
       params = getParams();
       firstname = unescape( params["Name"] );
       document.getElementById("d").innerHTML = firstname;
    &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;input type="text" id="d" value=""&gt;
    &lt;/body&gt;
    &lt;/html&gt;   
  </code></pre>
  
  <p>if i print first name using document.write(); it working fine but not able print same in html text box</p>
  
  <h2>Note :</h2>
  
  <p>we wont change the java script to body it must be present inside  and text field must present inside the body tag.  is it possible???</p>