亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

reset函數運行不了,是什么鬼??????

reset函數運行不了,是什么鬼?????

正在回答

4 回答

reset是關鍵字,不能用否則有沖突,你可以改成其他名字,這種簡單而且涉及操作的英文如果出問題了,實在找不到原因基本上都可以注意一下是不是關鍵字沖突。

0 回復 有任何疑惑可以回復我~
改一下函數名就可以了,不能用reset,會有沖突的。


0 回復 有任何疑惑可以回復我~

其他的都能用就reset不行

0 回復 有任何疑惑可以回復我~

<input type="button" onclick="changecolor()" value="改變顏色" >??

? ? <input type="button" onclick="changewidth()" value="改變寬高" >

? ? <input type="button" onclick="content()" value="隱藏內容" >

? ? <input type="button" onclick="display()" value="顯示內容" >

? ? <input type="button" onclick="reset()" value="取消設置" >

? </form>

? <script type="text/javascript">

? ? var text=document.getElementById('con');

? ? var box=document.getElementById('txt');

? ? function changecolor(){

? ? ? ? text.style.color='red';

? ? ? ? box.style.backgroundColor='gray';

? ? }

? ? function changewidth(){

? ? ? ? var box=document.getElementById('txt');

? ? ? ? box.style.width='200px';

? ? ? ? box.style.height='500px';

? ? }

? function content(){

? ? ? box.style.display="none";

? }

? function display(){

? ? ? box.style.display="block";

? }

? ? function reset(){

? ? ? ? var srs = confirm("確認取消設置?");

? ? ? ? if (srs==true)

? ? ? ? {

? ? ? ? ? ? box.style.color = "black";

? ? ? ? ? ? box.style.backgroundColor = "white";

? ? ? ? ? ? box.style.width = orignWidth;

? ? ? ? ? ? box.style.height = orignHeight;

? ? ? ? ? ? box.style.display = "block";

? ? ? ? }

? ? }

? </script>

</body>

</html>


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

reset函數運行不了,是什么鬼??????

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號