當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
javascript学习代码
生活随笔
收集整理的這篇文章主要介紹了
javascript学习代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
點擊改變p和div元素:
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>test javascript</title> <style type="text/css">body{margin:0px;padding:0px;background:#999999;}#button{border-radius:6px;color:#00FF00;font-size:16px;} </style> </head><body> <h1>My Site</h1> <p id="demo">一個段落</p> <div id="myDIV" onclick="JavaScript:alert("hello lt")">一個div塊</div> <button type="button" id="button" onclick="myFunction()" >click me</button> <script type="text/javascript">function myFunction(){document.getElementById("demo").innerHTML="Hello world!";document.getElementById("myDIV").innerHTML = "How are you!";} </script> </body> </html>?
轉載于:https://www.cnblogs.com/blogofwyl/p/4541485.html
總結
以上是生活随笔為你收集整理的javascript学习代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python安装scikit-learn
- 下一篇: Spring学习使用标签来标记资源(@C