【发布时间】:2017-02-27 18:02:33
【问题描述】:
我可以选择使用 Adobe Flash 或使用 javascript 创建动态弓弦网站。如何使用 PHP 创建选择提交给 MySql 的颜色?
<html>
<head>
<TITLE>Cool Javascript</title>
<style>
body {
background-color: linen;
margin: 0;
}
#blueDiv {
position: absolute;
top: 100px;
background-color: blue;
width: 150px;
height: 150px;
}
#yellowDiv {
position: absolute;
top: 100px;
background-color: yellow;
width: 150px;
height: 150px;
}
</style>
</head>
<body>
<button onclick="blue()"> blue button </button>
<button onclick="yellow()"> yellow button </button>
<div id="blueDiv">
</div>
<script>
var div = document.getElementById('blueDiv');
function blue() {
div.setAttribute("id", "blueDiv");
}
function yellow() {
div.setAttribute("id", "yellowDiv");
}
</script>
</body>
</html>
我可能需要考虑在我的 css 脚本中使用图像。 请就上述内容提出建议,因为我已经坚持了好几个月了。
【问题讨论】:
标签: javascript php css dynamic