<div class="codetitle"> <span><a style="CURSOR: pointer" data="78692" class="copybut" id="copybut78692" onclick="doCopy('code78692')"><u>複製程式碼</u></a></span> 程式碼如下:</div> <div class="codebody" id="code78692"> <br>var sel=document.getElementByIdlectid); id <br>var index=sel.selectedIndex;//取得被選取的option的索引<br>var textsel= sel.options[index].text;//取得對應的option的內容<br> </div>