qq_vocaloid第一3361037
2017-07-05 15:45
<html>
<head>
<title>hello</title>
<script>
function show_text(id,text)
{ document.getElementById(id).innerHTML=text;
}
function show_color(id,color)
{ document.getElementById(id).style.color=color;
}
</script>
<style>
div p { color : #f00 }
.py { font-size : 40px; }
#l1 { width : 200px; font-size:40ppx; }
</style>
</head>
<body>
<hl>hello</hl>
<div>World</div>
<p class="py">python</p>
<label id="l1">test</label>
<div>
<a href="javascript:void(0);" onclick=' javascript:show_text("l1","My First JavaScript");'>My First JavaScript</a>
<a href="javascript:void(0);" onclick=' javascript:show_text("l1","Hello python");'>Hello python</a>
<a href="javascript:void(0);" onclick=' javascript:show_text("l1","#0f0");'>green</a>
<a href="javascript:void(0);" onclick=' javascript:show_text("l1","#f00";'>red</a>
</div>
</body>
</html>
你这个copy错了:
<a href="javascript:void(0);" onclick=' javascript:show_color("l1","#0f0");'>green</a>
<a href="javascript:void(0);" onclick=' javascript:show_color("l1","#f00");'>red</a>
python-web.py开发入门
58639 学习 · 106 问题
相似问题