php + js 勾选A select 同步B select
要如何写勾选A时,B会同步?
<br /><select id="A" name="A" ><br /><?php<br /> $query = $db->query("<br /> SELECT * FROM `select`"); <br /> foreach($query->result() as $row){ <br />?> <br /><option value="<?php echo $row->id;?>"><?php echo $row->name;?></option><br /><?php<br /> }<br />?> <br /></select><br /> <br /> <br /><?php<br /> $query = $db->query("<br /> SELECT * FROM `test`"); <br /> foreach($query->result() as $row){ <br />?> <br /><select id="B" name="B[]" ><br /><?php<br /> $query1 = $db->query("<br /> SELECT * FROM `select`"); <br /> foreach($query1->result() as $row){ <br />?> <br /><option value="<?php echo $row1->id;?>"><?php echo $row1->name;?></option><br /><?php<br /> }<br />?> <br /></select><br /><?php<br /> }<br />?> <br />