js初步简单的编程代码
简单图片切换编码demo
图片地址自行替换
简单图片切换编码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>网页标题</title> <meta name="keywords" content="关键字列表" /> <meta name="description" content="网页描述" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"></style> </head> <body> <img src="jd1.png" id="changeImg"> <script type="text/javascript"> var imgObj=document.getElementById("changeImg"); //通过id的属性值获取元素 imgObj.onmouseover=function(){ imgObj.src="jd2.png";} //实现功能(鼠标点在图片上)变换图片 imgObj.onmouseout=function(){ imgObj.src="jd1.png";} //实现功能(鼠标离开图片)变换图片 </script> </body> </html>
嵌套有序列表的相加合并属性简单编程demo
嵌套有序列表的相加合并属性简单编程
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>网页标题</title> <meta name="keywords" content="关键字列表" /> <meta name="description" content="网页描述" /> <link rel="stylesheet" type="text/css" href="" /> <style type="text/css"></style> <script type="text/javascript"> var username="王宝强"; var age=38; var jjr="隔壁老宋"; var job="演员"; var sex="男"; document.write("<ol>"); document.write("<li>明星:"+username+"</li>"); document.write("<li>年龄:"+age+"</li>"); document.write("<li>经纪人:"+jjr+"</li>"); document.write("<li>职业:"+job+"</li>"); document.write("<li>性别;"+sex+"</li>"); document.write("</ol>"); </script> </head> <body> </body> </html>