Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Javascript code for change Decimal to a Hexadecimal Value ?

Please check ...what is wrong here ?

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



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

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900