Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>HTML:</p> <pre><code>&lt;div class = "right"&gt; &lt;h4 class = "heading"&gt; Browse Listings &lt;/h4&gt; &lt;select style = "margin-top: 55px; margin-left: 18px;" name="image" id="image1" class="inputbox" size="1"&gt; &lt;option value=""&gt; - Select - &lt;/option&gt; &lt;option value="farm-land" &gt;Farm Lands&lt;/option&gt; &lt;option value="flats" alt = "flat.html"&gt;Flats&lt;/option&gt; &lt;option value="house" alt = "house.html"&gt;Houses&lt;/option&gt; &lt;option value="vacant" alt = "vacant.html"&gt;Vacant Lands&lt;/option&gt; &lt;option value="villas" alt = "villa.html"&gt;Villas&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <p>JQUERY:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $("#image1").change(function() { $("#imagePreview").empty(); if ( $("#image1").val()!="" ) { window.location.href = "http://domain/" + $(this).val() + ".html"; } else { //anything } }); }); &lt;/script&gt; </code></pre> <hr> <p><strong>NOTE: give only page name without <code>.html</code> in value of options in select <code>.html/.php/any extension</code> and site URL can append in JS</strong></p> <h2>New Requirement</h2> <p>add image and its link </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $("#image1").change(function() { $("#imagePreview").empty(); if ( $("#image1").val()!="" ) { "$("#imagePreview").append("&lt;a src="http://domain/" + $(this).val() + ".html"&gt; &lt;img src=\"" + $(this).attr("alt"); + "\" /&gt;&lt;/a&gt;"); } else { //anything } }); }); &lt;/script&gt; </code></pre> <h2>NOTE</h2> <p>may be syntex is some how wrong but the way is this </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload