![]() Mostly it may be made up of HTML elements like div. In games, the scenes don’t always have a button to trigger the counter increment. ![]() Almost all HTML elements have the click event with the onclick event handler. To make it flexible, we will have to support the feature for other HTML elements such as div, li etc. In most use cases, we may not apply the click counter always on a button. The above code sample displays the click counter and increments it on a button click. The innerHTML attribute further changes the text that is displayed in the HTML GUI Interface. It uses the document.getElementById() function of javascript to query for the HTML element with id counter-label and then updates the innerHTML attribute with the new counter value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |