為什么我取消設(shè)置點(diǎn)了沒(méi)反應(yīng)啊 我抄下面代碼復(fù)制也沒(méi)反應(yīng)。。哥哥幫忙看看我的代碼哪里有問(wèn)題
<input type="button" value="改變顏色" onclick="changecolor()"/> ?
? ? <input type="button" value="改變寬高" onclick="gaodu()"/>
? ? <input type="button" value="隱藏內(nèi)容" onclick="yincang()"/>
? ? <input type="button" value="顯示內(nèi)容" onclick="xianshi()"/>
? ? <input type="button" value="取消設(shè)置" 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('確認(rèn)取消設(shè)置嗎?');
? ? if(ox==true){
? ? ? ? ?{cz.style="none");}
? ? ?}
}
??
2016-09-16
{cz.style="none");} 多了半邊括號(hào));
<input type="button" value="取消設(shè)置" onclick="quxiao"/>
這里的quxiao沒(méi)有加上()
2016-09-16
? <input type="button" value="取消設(shè)置" onclick="quxiao"/>
這里的quxiao沒(méi)有加上()