<script type="text/javascript" src="js/jquery.js"> </script> <script type="text/javascript"> var tables=new Array(); tables['fiat']=new Array(); tables['opel']=new Array(); tables['opel'][0]=('corsa'); tables['opel'][1]=('astra'); tables['opel'][2]=('vectra'); tables['fiat'][0]=('multipla'); tables['fiat'][1]=('brava'); for(index in tables) { $('#marka').append('<option>' +[index] +'</option>'); } $('#marka').change(function(){ var wybrana_marka=$('#marka').val(); for(i=0; i<tables[wybrana_marka].length; i++) { $('#model').html('<option>' +tables[wybrana_marka][i] +'</option>'); } }) </script>
Dodaje link do strony:
link
Będę wdzięczny za pomoc.