提交 c8350949 编写于 作者: P Prathamesh Sonpatki

Fix paintIt method in JavaScript guides [ci skip]

- Changed "paintIt" to "@paintIt" so that it can be called in an on
  click handler.
- Closes #22568
上级 eb0e8e21
......@@ -81,7 +81,7 @@ Awkward, right? We could pull the function definition out of the click handler,
and turn it into CoffeeScript:
```coffeescript
paintIt = (element, backgroundColor, textColor) ->
@paintIt = (element, backgroundColor, textColor) ->
element.style.backgroundColor = backgroundColor
if textColor?
element.style.color = textColor
......@@ -107,7 +107,7 @@ attribute to our link, and then bind a handler to the click event of every link
that has that attribute:
```coffeescript
paintIt = (element, backgroundColor, textColor) ->
@paintIt = (element, backgroundColor, textColor) ->
element.style.backgroundColor = backgroundColor
if textColor?
element.style.color = textColor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册