das ist mein code aber der geht irgendwie nicht
PHP:
<!DOCTYPE html>
<html>
<?php include 'html.php'; ?>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<head>
<?php include 'head.php'; ?>
</head>
<body>
<header>
<?php include 'navi.php'; ?>
</header>
<div>
<table class="tabelle separate">
<tr>
<td class="zelle3" style="width:50px"><img src="" id="bild" height="45" style="float:mittle" width="45" /></td>
<td class="zelle3" colspan="3" style="width:650px"><span id="beschreibung" ></span></td>
</tr>
<tr> <td class="zelle3" colspan="2" style="width:350px">Rohstoffe:</td>
<td class="zelle3" colspan="2" style="width:350px">
<select id="auswahl">
<option value=""></option>
<option value="1">Nadelholz</option>
<option value="2">Nadelholzbretter</option>
</select>
</td>
</tr>
</table>
</div>
<script>
var bild=['Bilder/Rohstoffe/nadelholz.png','Bilder/Rohstoffe/nadelholzbretter.png',];
var beschreibung=[ 'Bilder/Rohstoffe/Produktion-nadelholzstamm.png ',
'Test',
];
$('#auswahl').change(function(){
var u=$('#auswahl').val();
var s=u-1;
var dd='https://siedleronline.lima.zone/'+bild[s];
$('#bild').attr('src',dd);
$('#beschreibung').html(beschreibung[s]);
});
$('#bild').attr('src',localStorage.getItem("bild"));
$('#beschreibung').html(localStorage.getItem("beschreibung"));
</script>
<?php include 'Footer.php'; ?>
</body>
</html>
Zuletzt bearbeitet von einem Moderator: