我的表單應該顯示基於在兩個不同字段中選擇的單選按鈕(形式爲&顏色)的圖像。jQuery語法的條件邏輯與單選按鈕?
我已經成功地創建了帶有鏈接的對象作爲每個屬性的值。 現在我如何告訴jQuery更改#image的來源,例如我選擇gold + round?
這裏是虛擬圖片小提琴:https://jsfiddle.net/fbzf10x6/10/
<body>
<form action="">
<input type="radio" name="color" value="silver"> silver
<br>
<input type="radio" name="color" value="gold"> gold
<br>
<input type="radio" name="color" value="platin"> platin
<br> <br>
<input type="radio" name="form" value="round"> round
<br>
<input type="radio" name="form" value="oval"> oval
<br>
</form>
<div><img id="image" src="#"></div>
</body>
我覺得在你的小提琴對象不爲您服務您的解釋基礎這裏需要。 對象應該包含如下組合: 'images = {silverround:「link1」,silveroval:「link2」,....} – CardCaptor