<div class="codetitle"> <span><a style="CURSOR: pointer" data="9394" class="copybut" id="copybut9394" onclick="doCopy('code9394')"><u>複製代碼</u></a></span>如下代號:</div> <div class="codebody" id="code9394"> <br>場//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8">> <br><title>10發光 2發光</title> <br>頭> <br><br> <br>十進位: <br> <input type="text" id="decimal"> > <br>> <br>二進位: <br> <input type="text" id="binary"> <br> <input type="button" value="to Decimal" onclick="return toDecimal();">> <br><br> <br><script type="text/scriptscript"> <BR><script type="text/scriptscript"> document.getElementById('decimal'); <BR>var b = document.getElementById('binary'); <BR><br>function toBinary() { <br><BR>function toBinary() { <BR><BR>function toBinary() { < value> isNaN(num) || !num) { <BR> d.value = ""; <BR> 返回false; toString(2); <BR>} <BR><br>function toDecimal() { <br> var num = b.value; <BR> <BR> 返回false; <BR> } <BR> d.value = parseInt(num, 2); > 🎜 ><BR></script> </div>