function clock(){ document.getElementById("cc").style.color = document.getElementById("cl").value; } setInterval("clock()",5000); </script> </head> <body> <form> <input type="text" id="cl" size="50" value="blue" /> <input type="text" id="clock" size="50" /> <div style="background:red;width:100px;height:300px" id ="cc" value="1111111">11111</div>
通过对text内容获取颜色 进而改变到111111上面?