将十进制更改为十六进制值的Javascript代码?

问题描述:

将十进制更改为十六进制值的Java代码?

请检查...这里出什么问题了?

Javascript code for change Decimal to a Hexadecimal Value ?

Please check ...what is wrong here ?

<script  type="text/javascript">
    function hexa()
    {
   var txtHexa=document.getElementById('txtHexa').value;
   alert(txtHexa.toString(16));
    }
   </script>







<div>
       <asp:TextBox ID="txtHexa" runat="server"></asp:TextBox><input id="Submit1" type="submit" onclick="hexa()"

           value="submit" />
   </div>

请查看我的JavaScript计算器页面:
http://www.sakryukov.org/freeware/calculator/ [
Please look at my JavaScript calculator page:
http://www.sakryukov.org/freeware/calculator/[^].

View page source and locate the function this.hex — it does what you need.

—SA