html和css例子,html+javascript+css简单例子

本文展示了一个结合HTML、JavaScript和CSS的简单示例。在同一个文件夹中,创建了action1.js、content1.html和display.css。content1.html包含输入字段和事件监听,action1.js实现了页面加载后的初始化功能,包括数字转换和按钮点击事件。display.css定义了链接的样式。文章探讨了parseInt函数的使用以及不同进制之间的转换。
摘要由CSDN通过智能技术生成

html+javascript+css简单例子

2018-11-23

在同一文件夹里新建action1.js,content1.html和display.css

content1.html源代码

the tutionJsp index page 
INPUT 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值