{"id":93,"date":"2024-02-23T15:05:55","date_gmt":"2024-02-23T15:05:55","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_mermur\/?p=93"},"modified":"2024-02-23T15:05:55","modified_gmt":"2024-02-23T15:05:55","slug":"onclick-javascript","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_mermur\/2024\/02\/23\/onclick-javascript\/","title":{"rendered":"onclick JavaScript"},"content":{"rendered":"\n<p>I add button that counts how many clicks did you clicked I learned how to do it in JavaScript thx for <a href=\"http:\/\/theroyalscode.com\/ehs\">mrw<\/a> for helping me &lt;3<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"386\" src=\"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/232-1024x386.png\" alt=\"\" class=\"wp-image-94\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/232-1024x386.png 1024w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/232-300x113.png 300w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/232-768x290.png 768w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/232-1536x579.png 1536w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/232.png 1851w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/23222-1024x576.png\" alt=\"\" class=\"wp-image-96\" srcset=\"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/23222-1024x576.png 1024w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/23222-300x169.png 300w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/23222-768x432.png 768w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/23222-1536x864.png 1536w, https:\/\/theroyalscode.com\/students\/a_mermur\/wp-content\/uploads\/2024\/02\/23222.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\nconst count1 = document.getElementById(\"count1\");\nlet clicks = 0;\n\n\nfunction countClick() {\n   clicks += 1\n   count1.textContent = clicks;\n   console.log(clicks)\n}<\/code><\/pre>\n\n\n\n<p>This is the code of JavaScript we put the clicks 0 and if you press the button its gonad +1 like clicks +=1.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I add button that counts how many clicks did you clicked I learned how to do it in JavaScript thx for mrw for helping me &lt;3 This is the code of JavaScript we put the clicks 0 and if you press the button its gonad +1 like clicks +=1.<\/p>\n","protected":false},"author":1,"featured_media":94,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/posts\/93\/revisions\/97"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/media\/94"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mermur\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}