為什么我取消設置點了沒反應啊 我抄下面代碼復制也沒反應。。哥哥幫忙看看我的代碼哪里有問題
<input type="button" value="改變顏色" onclick="changecolor()"/> ?
? ? <input type="button" value="改變寬高" onclick="gaodu()"/>
? ? <input type="button" value="隱藏內容" onclick="yincang()"/>
? ? <input type="button" value="顯示內容" onclick="xianshi()"/>
? ? <input type="button" value="取消設置" onclick="quxiao"/>
? </form>
? <script type="text/javascript">
? ?function changecolor(){
? ? ? ? var mycolor=document.getElementById("txt")
? ? ? ? mycolor.style.backgroundColor="red"
? ?}?
?function gaodu(){
? ? ?var mygaodu=document.getElementById("txt")
? ? ? mygaodu.style.width="500px"
? ? ? mygaodu.style.height="500px"
?}
? function yincang(){
? ? ? var shufu=document.getElementById("txt")
? ? ? ?shufu.style.display="none";
? ? ??
? ? ??
? }
? function xianshi(){
? ? ? var xianshi=document.getElementById("txt")
? ? ? ?xianshi.style.display="block";
? ? ??
? }
? ? ? function quxiao(){
? ? var cz = document.getElementById("txt");
? ? var ox=confirm('確認取消設置嗎?');
? ? if(ox==true){
? ? ? ? ?{cz.style="none");}
? ? ?}
}
??
2016-09-16
{cz.style="none");} 多了半邊括號);
<input type="button" value="取消設置" onclick="quxiao"/>
這里的quxiao沒有加上()
2016-09-16
? <input type="button" value="取消設置" onclick="quxiao"/>
這里的quxiao沒有加上()