程序源入坑之路4(web)
来源:互联网 发布:网络麻将 编辑:程序博客网 时间:2024/06/18 07:20
1.在js里定义一个方法(yanzheng),检测姓名不能为空,身份证号为18位,才会返回ok。
<html><head> <title>大表单</title><script> function yanzheng(){ var input_name = document.getElementById("name"); var input_cardid = document.getElementById("cardid"); var cardid = input_cardid.value; var name = input_name.value; //alert(name); if(name.length===0){ //name!="" alert("姓名不能为空"); return; } if(cardid.length!==18){ alert("身份证号数字长度不符合格式"); return; } alert('ok'); }</script></head><body> <p>请输入所需要的信息:</p> 姓名:<input id="name" type="text"/><br/><br/> 出生年月:<input type="text"/><br/><br/> 身份证号:<input id="cardid" type="text"/><br/><br/> 个人爱好:<input type="text"/><br/><br/> <input type="button" value="提交。。内容" onclick="yanzheng()"/></body></html>
2.课程标为20px,红色,斜体
主要为类选择符和css的三种用法
<html><head> <style> /* .kecheng { font-size:20px; color:red; font-style:italic; }*/ </style> <link href="kecheng.css" rel="stylesheet" type="text/css"></head><body> <p>谢谢你<span class="kecheng">课程</span>本学期选修<span style="font-size:20;color:blue;font-weight:bold;">中国传统文化概论</span><span class="kecheng">课程</span>!</p> <p>为了能把本门<span class="kecheng">课程</span>建设成为一门更加优秀的<span class="kecheng">课程</span>,我们设计了本<span class="kecheng">课程</span>份问卷,请大家大胆如实填写<span class="kecheng">课程</span>,谢谢!</p></body></html>
.kecheng { font-size:20px; color:red; font-style:italic; }
3.
//border表示表格线为一像素,cellspacing表示表格间隙,如果不设置为零,默认值为1px
<html><head></head><body> <table border="1" cellspacing="0"> <thead style="font-size:20px"> <tr> <th>书名</th> <th>价格</th> </tr> </thead> <tbody style="font-size:14px;color:red;"> <tr> <td>javascript</td> <td>20.0</td> </tr> <tr> <td>javas</td> <td>820.0</td> </tr> </tbody> </table></body></html>
1 0
- 程序源入坑之路4(web)
- Web开发之程序开发
- 三年程序学习之二:(对web初认识)
- (四)WebService之CXF和Web程序的整合
- Labview学习之程序Web发布
- Web开发之程序上传到服务器
- 程序源入坑之路1
- 程序源入坑之路2
- 程序源入坑之路3
- Ninject之旅之十四:Ninject在ASP.NET Web Form程序上的应用(附程序下载)
- Asp.net程序性能优化的七个方面之五(配置web.config)
- web程序中全优化(一)之 提高用户体验度Tips
- web程序中全优化(二)之 提高你的JavaScript效率Tips
- 程序源入坑之路5(c语言入门)
- web前端学习之路(一)
- Web开发者之路(一):序篇
- WEB开发之路
- Web开发之路
- 内存错误几点
- 开发艺术探索阅读总结(1.2)异常情况下的生命周期分析
- U3D添加按钮相应事件
- 搭建云端服务器
- 书面格式解惑篇
- 程序源入坑之路4(web)
- Makefile 使用总结
- Eclipse提高开发效率的快捷键
- 开发艺术探索总结-activity的启动模式
- iOS 【自定义 抛出异常】
- 找出数组中只出现一次的2个数字
- 求S=a+aa+aaa+aaaa+aa...a的值
- log4j的优先级解读与简单实例
- Fragment的Tab加载方式