小编Gre*_*reg的帖子

如何从 HTML 中的颜色选择器中删除“其他...”选项?

我想删除此处的“其他...”按钮

如何删除这个“其他...”按钮?

我的 HTML 代码如下: 该代码应该更新

通过从下拉列表中选择颜色来文本。我想限制用户只能使用我列出的颜色。

<body>
  <p>An example demonstrating the use of the <code>&lt;input type="color"&gt;</code>
     control.</p>

  <label for="colorWell">Color:</label>
  <input type="color" value="#ff0000" id="colorWell" list="presetColors">
 <datalist id="presetColors">
   <option>#ff0000</option>
   <option>#00ff00</option>
   <option>#0000ff</option>
 </datalist>

  <p>Watch the paragraph colors change when you adjust the color picker.
     As you make changes in the color picker, the first paragraph's
     color changes, as a preview (this uses the <code>input</code>
     event). When you close the color picker, the <code>change</code>
     event fires, and we detect that to change every paragraph …
Run Code Online (Sandbox Code Playgroud)

html javascript css

5
推荐指数
1
解决办法
1580
查看次数

方案 if 语句。为什么这个显示语句没有运行?

我正在运行以下代码:

(define (myignore x)
    0
)
(define (myinterpreter mylist)
  (evaluate mylist)
)

(define (evaluate mylist)

  (if (eqv? (car mylist) 'prog)
    (evaluate (cdr mylist))
    (display (integer? (car mylist)))
    (if (integer? (car mylist))
      (display "YESSS")
    )
  )

  (if (eqv? (car mylist) 'myignore)
    (myignore (cdr mylist))
  )

)

(myinterpreter '(prog 5))
Run Code Online (Sandbox Code Playgroud)

我想知道为什么包含 (display ("YESSS")) 的行不运行,尽管 (display (integer? (car mylist))) 在该行运行之前等于 true?

lisp scheme functional-programming

1
推荐指数
1
解决办法
175
查看次数

使用方案调用函数

我正在尝试运行以下代码:

(define (myadd x y)
    (+ x y)
)

(myadd '(3 4))
Run Code Online (Sandbox Code Playgroud)

但是,我收到以下错误:

Error: +: number required, but got (3 4) [myadd, +]
Run Code Online (Sandbox Code Playgroud)

如何让 myadd 函数返回 7?

scheme functional-programming

1
推荐指数
1
解决办法
42
查看次数

如何从方案中的函数返回值

我正在运行以下代码:

(define (myadd x y)
    (+ x y)
    (display (+ x y))
)

(define (mymul x y)
    (* x y)
    (display (* x y))
)

(apply myadd '(3 (apply mymul '(3 4)))
Run Code Online (Sandbox Code Playgroud)

我试图在运行时得到答案 12,(apply myadd '(3 (apply mymul '(3 4)))但出现以下错误:

错误:+: number required, but got (apply mymul (quote (3 4))) [apply, (anon), +]

scheme functional-programming

0
推荐指数
1
解决办法
61
查看次数

标签 统计

functional-programming ×3

scheme ×3

css ×1

html ×1

javascript ×1

lisp ×1