close

 

在內文中顯示值

 

 

.php↓


 

<!DOCTYPE html>
<html >

<body>option1:
<select id="op1">
<option VALUE='1'>1</option>
<option VALUE='2'>2</option>
<option VALUE='3'>3</option>
</select>
option2:
<select id="op2" >
<option VALUE='4'>4</option>
<option VALUE='5'>5</option>
<option VALUE='6'>6</option>
</select>

<button onclick="show();">show</button><br>
<br><br>
<p id="s1"></p>
<p id="s2"></p>
</body>
<script type="text/javascript">
function show(){
var a=document.getElementById("op1").value;
var b=document.getElementById("op2").value;
document.getElementById("s1").innerHTML='option1: '+a;
document.getElementById("s2").innerHTML='option2: '+b;
}
</script>
</html>


 

 

2015-08-21_17-22-32

 

 

 

2015-08-21_17-23-17

 

 

 

2015-08-21_17-23-30  

完成!

 

arrow
arrow

    scud 發表在 痞客邦 留言(0) 人氣()