請問,這種情況下點擊改變顏色,為何北京顏色沒有變化?
? ? <input type="button" value="改變顏色" onclick="changecolor()"> ?
? ? <input type="button" value="改變寬高" >
? ? <input type="button" value="隱藏內容" >
? ? <input type="button" value="顯示內容" >
? ? <input type="button" value="取消設置" >
? </form>
? <script type="text/javascript">
? var txt=document.getElementById("txt");
?
? ? function:changecolor()
? ? ?{
? ? ? ? ?txt.style.color="red";
? ? ? ? ?txt.style.backgroundColor="#ccc";
? ? ?}
2015-02-05
function后面不能有冒號