Open
Conversation
added 3 commits
August 7, 2018 11:14
huluoyang
suggested changes
Aug 8, 2018
| "title": "Handle Click Events with JavaScript using the onclick property", | ||
| "description": [ | ||
| "You want your code to execute only once your page has finished loading. For that purpose, you can attach a JavaScript event to the document called <code>DOMContentLoaded</code>. Here's the code that does this:", | ||
| "你希望代码仅在页面完成加载后执行。为此,你可将名为<code>DOMContentLoaded</code>的 JavaScript 事件附加到文档中。如例:", |
| "你希望代码仅在页面完成加载后执行。为此,你可将名为<code>DOMContentLoaded</code>的 JavaScript 事件附加到文档中。如例:", | ||
| "<blockquote>document.addEventListener('DOMContentLoaded',function() {<br><br>});</blockquote>", | ||
| "You can implement event handlers that go inside of the <code>DOMContentLoaded</code> function. You can implement an <code>onclick</code> event handler which triggers when the user clicks on the element with id <code>getMessage</code>, by adding the following code:", | ||
| "你可以执行在<code>DOMContentLoaded</code>函数内部的事件处理程序。添加<code>onclick</code>事件处理器,当用户点击 id 为<code>getMessage</code>的元素时会触发事件。添加以下代码:", |
| "<script>", | ||
| " document.addEventListener('DOMContentLoaded',function(){", | ||
| " // Add your code below this line", | ||
| " // 在该行下添加代码", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.