title: Javascript change <p> content depending on select option
body: <p>not the best with Javascript so thought i'd ask where i'm going wrong.</p>
  
  <p>as the title suggests, I have a select box with 4 different options, when an option is selected I want to change the contents of a <code>&lt;p&gt;</code> tag with id of pricedesc. Here is what I have so far.</p>
  
  <pre><code>function priceText(sel)
  {
      var listingType = document.getElementById('listingtype');
      var priceDesc = document.getElementById('pricedesc');
      if ( sel.options[sel.selectedIndex].value == "Residential Letting" ) {
      priceDesc = "Enter price per month";
      }
      else if ( sel.options[sel.selectedIndex].value == "Short Let" ) {
      priceDesc = "Enter price per week";
      }
      else if ( sel.options[sel.selectedIndex].value == "Serviced Accommodation" ) {
      priceDesc = "Enter price per week";
      }
      else if ( sel.options[sel.selectedIndex].value == "Sale" ) {
      priceDesc = "Enter for sale price";
      }
  
  } 
  </code></pre>
  
  <p>and in the body i have:</p>
  
  <pre><code>            &lt;label&gt;Listing Type:&lt;/label&gt;
              &lt;select name="listingtype" id="listingtype" onchange="priceText(this);"&gt;
                  &lt;option value="Residential Letting"&gt;Residential Letting&lt;/option&gt;
                  &lt;option value="Short Let"&gt;Short Let&lt;/option&gt;
                  &lt;option value="Serviced Accommodation"&gt;Serviced Accommodation&lt;/option&gt;
                  &lt;option value="Sale"&gt;Sale&lt;/option&gt;
              &lt;/select&gt;
  
  
              &lt;label&gt;Price:&lt;/label&gt;
              &lt;p id="pricedesc"&gt;Enter price&lt;/p&gt;
              &lt;input name="price" type="text" id="price" value="&lt;%=Request.Form("price")%&gt;" maxlength="10" /&gt;
  </code></pre>
  
  <p>Thanks for your help.</p>
  
  <p>J.</p>