<!DOCTYPE html> <html lang="zh-Hans-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="renderer" content="webkit" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="SiteName" content="网站的规范名称"> <meta name="SiteDomain" content="网站的英文域名"> <meta name="SiteIDCode" content="网站合法身份的标识"> <!-- 栏目页面 --> <meta name="ColumnName" content="栏目名称/频道/专题"> <meta name="ColumnDescription" content="栏目描述"> <meta name="ColumnKeywords" content="栏目关键词"> <meta name="ColumnType" content="栏目类别"> <!-- 内容页面 --> <meta name="ArticleTitle" content="标题"> <meta name="PubDate" content="发布时间:YYYY—MM—DD HH∶MM"> <meta name="ContentSource" content="来源"> <meta name="Keywords" content="关键词"> <meta name="Author" content="作者"> <meta name="Description" content="摘要"> <meta name="Image" content="图片"> <meta name="Url" content="网址"> <title>sscms-cli网站及新媒体云管理平台</title> <script> function displayDate() { document.getElementById("demo").innerHTML = Date(); console.log(demo) } </script> </head> <body> <div id="app"> <button onclick="document.getElementById('myimages').src='./k.gif'">开灯</button> <img id="myimages" src="./eg_bulboff.gif" alt=""> <button onclick="document.getElementById('myimages').src='./eg_bulboff.gif'">关灯</button> <p id="demo">改变颜色和样式</p> <button type="button" onclick="gaibian()">改变颜色</button> <script> function gaibian() { x = document.getElementById("demo") debugger; x.style.color = "#ff0000"; } </script> </div> </body> </html>
标签:function,script,demo,getElementById,例子,document From: https://www.cnblogs.com/xiongwei/p/16647274.html