i have a restaurant dropdown menulist, when sb clicks the one of the various meals i want a picture of it to <img id="menupic"src="picFold/actualPic.jpg" alt="Foto der Menüliste">. I only had partial success , who can help me finalize this task ? thx
sofar :
menu.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Speisemenue</title>
<link rel="stylesheet" href="jquery-ui-theme.css">
<script src="jquery-1.10.2.js"></script>
<script src="jquery-ui.js"></script>
<link rel="stylesheet" href="jquery-ui.css">
<link rel="stylesheet" href="style.css">
<script>
$(function() {
$( "#menu" ).menu();
});
</script>
<style>
.ui-menu { width: 150px; }
</style>
</head>
<body style="background:darkred">
<div><a class="homeButton" href="index.html">Home</a></div>
<ul id="menu">
<li>Pizzen
<ul>
<li onclick="actualPicSwap()" <img src="picFold/Pic13.jpg" >Pizza Mageritha 4,90€ - <span class="listenBildKonfig">Bild</span></li>
<li onclick="actualPicSwap()" <img src="picFold/Pic13.jpg" > >Pizza Cardinale 5,90€ - <span class="listenBildKonfig">Bild</span></li>
<li onclick="actualPicSwap()" <img src="picFold/Pic13.jpg" >Pizza Salami 5,90€ - <span class="listenBildKonfig">Bild</span></li>
<li onclick="actualPicSwap()" <img src="picFold/Pic13.jpg">Pizza Cardinale 5,90€ - <span class="listenBildKonfig">Bild</span></li>
</ul>
</li>
<img id="menupic"src="picFold/actualPic.jpg" alt="Foto der Menüliste">
<script>
function actualPicSwap()
{
document.getElementById("menupic").src = ??? ;
}
</script>
</body>
</html>
If:
??? = "picFold/Pic13.jpg" // works but, i want a function which i can add to each li item
??? = jQuery(this).find("src"); // doesnt work
??? = document.getElementByTagName("src") // doesnt work
Any Suggestions ?