我需要帮助隐藏/禁用按钮。 [英] I need help hiding/ disabling buttons.

查看:68
本文介绍了我需要帮助隐藏/禁用按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我13岁时正在尝试使用js。我正在尝试制作一个浏览器游戏。这是一个简单的数学游戏,只是基本的东西。我正在尝试在网页上有一个按钮列表,但你需要按顺序下去而不能选择问题2而不是问题一。如何在第一个问题完成之前使其他按钮处于非活动状态。


这是我的代码:(不是很好)

Hello, I''m 13 trying my luck with js. I am trying to make an in browser game. It is a simple math game, just basic stuff.I am trying to have a list of buttons on the webpage, but you need to go down in order without being able to pick question two instead of question one. How do i make the other buttons inactive until completion of the first question.

Here is my code:(Not really good)

展开 | 选择 | Wrap | 行号

推荐答案


这是一个简单的数学游戏
It is a simple math game



3 * 4 = 7 ???


一些注释:

  • 缺少Doctype
  • 缺少< title>
  • 语言属性已弃用,请使用 type =" text / javascript"
  • < center>不推荐使用CSS,而是使用CSS
  • 几个错别字
  • document.getElementById()是一个函数,而不是用于赋值的原语
  • if / else:检查括号数
  • 3 * 4 = 7 ???

    some notes:

    • missing Doctype
    • missing <title>
    • the language attribute is deprecated, use type="text/javascript"
    • <center> is deprecated, use CSS instead
    • several typos
    • document.getElementById() is a function, not a primitive for assignment
    • if/else: check the brace count

    • 是的,这只是我在学校开始前4:40 AM做的一些混合代码我正在努力的一些东西,并决定不使用它,忘了删除一些东西。我只给了你重要的东西,因为我不想给所有的东西,因为那会产生更多的线条。我打算删除
      yeah that''s just some mixed up code I was doing this at 4:40 AM before school started and some stuff I was working on and decided not to use it and forgot to remove some stuff.and i only gave you the important stuff because I didn''t want to give every thing because that would have made more lines. I was planning on removing the
      展开 | 选择 | Wrap | 行号



      当我试图弄清楚如何删除按钮
      was when i was trying to figure out how to delete a button



      足够简单:

      simple enough:

      展开 | 选择 | Wrap | 行号


      这篇关于我需要帮助隐藏/禁用按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆