简体   繁体   English

我希望下拉菜单选项在选择不同的选项时能够发布不同的图像

[英]I would like drop down menu selections to bring post different images when different choices are selected

Here is my basic pull down selection tabs. 这是我的基本下拉选择选项卡。 How do I get each choice to post a different image (preferably html source images) when selected. 选择后,如何获得发布不同图像(最好是html源图像)的每种选择。

I would like the images to post within the div as well if possible. 我希望这些图像也尽可能在div中发布。

 <div id= "PERSONAL">
   <p id= "Range"> Preferred Distance </p>
     <select class= "Distance" onchange="report(this.value)">
`     <option value="Pick3">Pick Your Range</option>
      <option value="100 Miles">100 Miles</option>
      <option value="1000 Miles">1000 Miles</option>
      <option value="More than 2000 Miles">More than 2000 Miles</option>
      <option value="Around the World">Around the World</option>
     </select>

    <p id= "Weather"> Preferred Weather </p>
     <select class= "Weather" onchange="report(this.value)">
       <option value="Pick2">Pick Your Weather</option>
       <option value="Cold">Cold</option>
       <option value="Mild">Mild</option>
       <option value="Hot">Hot</option>
       <option value="Anything">Anything</option>
      </select>

    <p id= "Moisture"> Wet or Dry </p>
     <select class= "Moisture" onchange="report(this.value)">
      <option value="Pick1">Pick Your Moisture</option>
      <option value="Desert">Desert Dry</option>
      <option value="Moderate">Wet and Dry</option>
      <option value="Rainy">Jungle Wet</option>
      <option value="Snow">Snow Time!</option>
     </select>

   </div>

You could create a placeholder <img> tag inside your <div> and change src accordingly on change() . 您可以在<div>内创建一个占位符<img>标记,并在change()上相应地更改src

Just expand on the sample that I provided. 只需扩展我提供的示例即可。

Example

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用数据库中的行/记录数据为下拉菜单生成选择项,从而在选择时预填表格? - How to generate selections for a drop down menu with row/record data from a database that will prefill a form when selected? 如何根据不同的下拉选项更改文本? - How to change text based on different drop down selections? 基于表单输入值,2如何生成选择4 4下拉菜单w从数据库中行/记录数据,将在选定时预填充表单? - Based on a forms input value, how 2 generate selections 4 a drop down menu w row/record data from a database that will prefill a form when selected? HTML链接会下拉一个像表单一样工作的菜单吗? - HTML Link which would drop down a menu working like a form? 需要根据下拉菜单中选择的国家显示不同的json文件 - Need to display different json files on the basis of nation selected in the drop down menu Javascript:如果用户在下拉菜单中选择了不同的选项,如何清除验证错误 - Javascript: How to clear validation errors if user has selected a different option in drop down menu 选择下拉菜单中的选项时无法获取图像以显示图像? - Can't get image to display images when option from drop down menu is selected? 如何使用“发布”方法将所有选定的数据从下拉菜单发送到服务器? - How do I send all selected data from the drop-down menu to the server with a “post” method? 我该如何改变 <div> 选择下拉框时的边框颜色 - How would i change a <div> border colour when a drop down box is selected 如何使我的下拉选项按其值改变我的总数,但除非选中,否则不会计算 - How can I make my drop down selections change my total by they're values but not be calculated unless selected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM