{"id":75,"date":"2024-02-16T15:17:54","date_gmt":"2024-02-16T15:17:54","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_carpenter\/?p=75"},"modified":"2024-02-16T15:17:54","modified_gmt":"2024-02-16T15:17:54","slug":"how-i-added-a-button","status":"publish","type":"post","link":"https:\/\/theroyalscode.com\/students\/a_carpenter\/2024\/02\/16\/how-i-added-a-button\/","title":{"rendered":"How I added a button"},"content":{"rendered":"\n<p>I added a button, and spent way too long on w3schools trying to make it function when all i needed was an &#8220;onclick&#8221; command.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"18\" src=\"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture6969.png\" alt=\"\" class=\"wp-image-76\" srcset=\"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture6969.png 697w, https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture6969-300x8.png 300w\" sizes=\"auto, (max-width: 697px) 100vw, 697px\" \/><\/figure>\n\n\n\n<p>as you can see, when clicked, the button runs my function &#8220;dontberacist&#8221;<\/p>\n\n\n\n<p>Here is the code to use a button and assign a function to be used.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;button onclick=\"insertfunctionnamehere()\" class=\"insertclasshere\"> Insert Text Here &lt;\/button>\n<\/code><\/pre>\n\n\n\n<p>I also added a small bit of information and will change the button to redirect to something useful later but that will be a surprise. Here is some of the info I added.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"36\" src=\"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture-1024x36.png\" alt=\"\" class=\"wp-image-77\" style=\"width:1450px;height:auto\" srcset=\"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture-1024x36.png 1024w, https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture-300x10.png 300w, https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture-768x27.png 768w, https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-content\/uploads\/2024\/02\/Capture.png 1289w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I added a button, and spent way too long on w3schools trying to make it function when all i needed was an &#8220;onclick&#8221; command. as you can see, when clicked, the button runs my function &#8220;dontberacist&#8221; Here is the code to use a button and assign a function to be used. I also added a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/posts\/75\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_carpenter\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}