幫忙看一下哪里錯了?點(diǎn)擊按鈕半點(diǎn)反應(yīng)都沒有。。
<form>
? <!--當(dāng)點(diǎn)擊相應(yīng)按鈕,執(zhí)行相應(yīng)操作,為按鈕添加相應(yīng)事件-->
? ? <input type="button" value="改變顏色" onClick="a()"> ?
? ? <input type="button" value="改變寬高" onClick="b()">
? ? <input type="button" value="隱藏內(nèi)容" onClick="c()">
? ? <input type="button" value="顯示內(nèi)容" onClick="d()">
? ? <input type="button" value="取消設(shè)置" onClick="e()">
? </form>
? <script type="text/javascript">
??
? ?
//定義"改變顏色"的函數(shù)
? ? fuction a(){
? ? ? ? if(confirm("確定改變顏色嘛?")){?
? ? ? ? ? ? var mychar = document.getElementById("txt");
? ? ? ? ? ? mychar.style.color="red";
? ? ? ? ? ? mychar.style.backgroundColor="#ccc";
? ? ? ? }
? ? }
//定義"改變寬高"的函數(shù)
? ? fuction b(){
? ? ? ? if(confirm("確定改變寬高?")){
? ? ? ? ? ? var mychar = document.getElementById("txt"); ?
? ? ? ? ? ? mychar.style.width="400px";
? ? ? ?mychar.style.height="200px";
? ? ? ? }
? ? }
//定義"隱藏內(nèi)容"的函數(shù)
? ? fuction c(){
? ? ? ? if(confirm("確定隱藏內(nèi)容?")){
? ? ? ? ? ? var mychar = document.getElementById("txt"); ?
? ? ? ? ? ? mychar.style.display="none";
? ? ? ? }
? ? }
//定義"顯示內(nèi)容"的函數(shù)
? ? fuction d(){?
? ? ? ? if(confirm("確定顯示內(nèi)容?")){
? ? ? ? ? ? var mychar = document.getElementById("txt"); ?
? ? ? ? ? ? mychar.style.display="block";
? ? ? ? }
? ? }
//定義"取消設(shè)置"的函數(shù)
? ? ?fuction e(){
? ? ? ? if(confirm("確定取消設(shè)置?")){
? ? ? ? ? ? var mychar = document.getElementById("txt"); ?
? ? ? ? ? ? mychar.style.color="#000";
? ? ? ?mychar.style.backgroundColor="#fff";
? ? ? ?mychar.style.width="600px";
? ? ? ?mychar.style.height="400px";
? ? ? ?mychar.style.display="block";
? ? ? ? }
? ? }
? </script>
2016-05-07
fuction拼錯了,應(yīng)該是function !!!