html+javascript+css简单例子
2018-11-23
在同一文件夹里新建action1.js,content1.html和display.css
content1.html源代码
the tutionJsp index pageINPUT DOLLAR AMOUNT |
action1.js源代码
window.onload = initPage;
function initPage(){ var a="11160"; alert(parseInt(a,2)); //将111做为2进制来转换,忽略60(不符合二进制),从左至右只将符合二进制数的进行转换 alert(parseInt(a,16)); //将所有的都进行转换
alert("this is initPage"); document.getElementById("confirm").onclick = function(evt){alert("the confirm button pressed!");}; document.getElementById("damount").onblur = blurBamt;}
function blurBamt(){ document.getElementById("damount").className = "ErrFld FontWhite FontYellow"; alert("THIS is blur bamt !!!".toLowerCase()); document.getElementById("damount").value = document.getElementById("damount").className; var a = 234; alert(parseInt(a,10).toString(16).toUpperCase()); //将A转换为10进制,然后再转换成16进制 同样也可以是其它进制 }
display1.css源代码
a { padding: 3px 10px; margin: 20px 10px; text-decoration: none; display: block; width: 260px; border-left: 1px solid #ccc; border-right: 2px solid black; border-top: 1px solid #ccc; border-bottom: 2px solid black;}
a:hover { color: white; background-color: #aaa;}
.ErrFld{ background-color: #FF0000;}
.FontWhite{ color: white; }
.FontYellow{ color: yellow; }
免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。
http://www.pinlue.com/style/images/nopic.gif