JavaScript Online Coding query tool _javascript Tips

Source: Internet
Author: User
<script type= "Text/javascript" >//<! [cdata[var begin = parseint (' 4e00 ', 16); var end = parseint (' 9fa5 ', 16); Alert (end.tostring (16)); alert (begin-end); function Getobj (ID) {return document.getElementById (ID); function showcharlist (begin, end) {getobj (' Txtbegin '). Value = BEGIN; Getobj (' Txtend '). Value = end; Btnquery_onclick (); function Btnquery_onclick () {var begin = parseint (Getobj (' Txtbegin '). Value); var end = parseint (Getobj (' Txtend '). Value); if (isNaN (begin) | | isNaN (END) | | End < BEGIN) {alert (' Digital input error!) Please check! '); Return } getobj (' Spanfontsize '). style.display = ' None '; Getobj (' spanloading '). style.display = ' inline '; var str = '; for (var i = begin; I <= end; i++) {str = String.fromCharCode (i); } getobj (' Txtcharcontent '). value = str; Getobj (' spanloading '). style.display = ' None '; Getobj (' Spanfontsize '). style.display = ' inline '; Getobj (' Spannum '). InnerHTML = Str.length; The function showNum16 () {var num = parseint (document.getelEmentbyid (' txt10a '). Value); document.getElementById (' txt16a '). Value = num.tostring (16); function ShowNum10 () {var = parseint (document.getElementById (' txt16b '). value, 16); document.getElementById (' txt10b '). Value = Num.tostring (10); function Showchar () {var = parseint (document.getElementById (' txtNum1 '). Value); if (isNaN (num)) {document.getElementById (' txtChar1 '). Value = '; else {document.getElementById (' txtChar1 '). Value = String.fromCharCode (num); The function Showcharnum () {var str = document.getElementById (' txtChar2 '). Value; var txtNum2 = document.getElementById (' txtNum2 '); Txtnum2.value = '; for (var i = 0; i < str.length i++) {txtnum2.value + = Str.charcodeat (i) + '; '; } function Settextfontsize (o, fontsize) {getobj (' txtcharcontent '). style.fontsize = fontsize + ' px '; Getobj (' Afontsmall '). Style.color = ' Gray '; Getobj (' Afontmiddle '). Style.color = ' Gray '; Getobj (' Afontbig '). Style.color = ' Gray '; O.style.color = ' Blue '; }//]]&Gt;</script> <p> Conversion </p> <p> 10 <input id= "txt10a" onkeyup= "showNum16 ();" type= "text"/& Gt > 16 <input id= "TXT16A" type= "text"/><br> 16 <input id= "txt16b" onkeyup= "SHOWNUM10" (); "Type=" text "/> > 10 <input id=" txt10b "type=" text "/></p> <p> encoding conversion </p> <p> digital <input id=" TxtNum1 "onkeyup=" Showchar (); "type=" text "value=" 22221 "/> > Character <input id=" txtChar1 "type=" text "value=" Double Happiness "/ ><br> character <input id= "TxtChar2" onkeyup= showcharnum (); "type=" text "/> > Digital <input id=" txtNum2 "type= "Text"/></p> <div > HTML can use <strong >& #22221;</strong> representation <strong > Double Happiness </strong > </div> <p> character encoding table </p> <table border= "2" cellpadding= "4" > <tbody> <tr> < Th> name </th> <th> range </th> <th> quantity </th> <th> view </th> </tr> <tr> & Lt;td> Chinese characters </td> &LT;TD&Gt;19968~40869</td> <td>20902</td> <td> View </td> </tr> <tr> <td> Common symbols, Numbers, characters </td> <td>33~126</td> <td>94</td> <td> view </td> </tr> <tr> <td> Digital </td> <td>48~57</td> <td>10</td> <td> view </td> </tr> < tr> <td> Capital Letter </td> <td>65~90</td> <td>26</td> <td> View </td> </tr > <tr> <td> lowercase letter </td> <td>97~122</td> <td>26</td> <td> View </td& Gt </tr> <tr> <td colspan= "4" > More reference: Code table </td> </tr> </tbody> </table> <div > Characters: <input id= "Txtbegin" type= "text"/> ~ <input id= "Txtend" type= "text"/> "<input" id= "Btnquery" Oncl Ick= "Btnquery_onclick ();" type= "button" value= "Query/> <span" id= "spanfontsize" > Small characters Total <span id= "span Num ">0</span> </SPAN> <span id= "spanloading" > Loading ...</span> </div> <p> <textarea id= "Txtcharcontent" &G T;</textarea></p>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.