javascript中改变html内容
<!DOCTYPEhtml><html><head><metacharset="utf-8"><title>菜鸟教程(runoob.com)</title></head>...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<p id="demo">my javescript</p>
<script>
function demochange(){
x=document.getElementByID("demo");//查找元素
x.innerHTML="Change";//改变内容
}
</script>
<button type="button" onclick="demochange()">show</button>
</body>
</html>
为什么我的没法改变 展开
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>
<p id="demo">my javescript</p>
<script>
function demochange(){
x=document.getElementByID("demo");//查找元素
x.innerHTML="Change";//改变内容
}
</script>
<button type="button" onclick="demochange()">show</button>
</body>
</html>
为什么我的没法改变 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询