js初步简单的编程代码
生活随笔
收集整理的這篇文章主要介紹了
js初步简单的编程代码
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
簡單圖片切換編碼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";}//實現(xiàn)功能(鼠標點在圖片上)變換圖片 imgObj.οnmοuseοut=function(){ imgObj.src="jd1.png";}//實現(xiàn)功能(鼠標離開圖片)變換圖片</script></body> </html>
<!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>職業(yè):"+job+"</li>");document.write("<li>性別;"+sex+"</li>");document.write("</ol>");</script> </head> <body></body> </html>
圖片地址自行替換 簡單圖片切換編碼
<!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";}//實現(xiàn)功能(鼠標點在圖片上)變換圖片 imgObj.οnmοuseοut=function(){ imgObj.src="jd1.png";}//實現(xiàn)功能(鼠標離開圖片)變換圖片</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>職業(yè):"+job+"</li>");document.write("<li>性別;"+sex+"</li>");document.write("</ol>");</script> </head> <body></body> </html>
?
轉載于:https://www.cnblogs.com/cxx8181602/p/6086589.html
總結
以上是生活随笔為你收集整理的js初步简单的编程代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【bzoj1705】[Usaco2007
- 下一篇: HDU 2874 Connections