為什么我取消的按鈕沒反應呢
</div>
? <form>
? <!--當點擊相應按鈕,執行相應操作,為按鈕添加相應事件-->
? ? <input type="button" value="改變顏色" onClick="colorChange()"/>??
? ? <input type="button" value="改變寬高" >
? ? <input type="button" value="隱藏內容" >
? ? <input type="button" value="顯示內容" >
? ? <input type="button" value="取消設置" onClick="refuse()"/>
? </form>
? <script type="text/javascript">
//定義"改變顏色"的函數
? ? ? ? var cc=document.getElementById("txt");
? ? function colorChange(){
? ? ? ? cc.style.color="red";
? ? }
// //定義"取消設置"的函數
? ? function quxiao(){
? ? ? var a=confirm('是否取消設置?');
? ? ? if(a==true){
? ? ? ? ? cc.removeAttribute('style');
? ? ? }
? }
? </script>
</body>
</html>
大佬幫忙看一下呀
2019-04-06
方法名不一致
2019-04-04
已解決