{"id":1276,"date":"2019-07-18T21:30:24","date_gmt":"2019-07-18T21:30:24","guid":{"rendered":"https:\/\/www.copahost.com\/blog\/?p=1276"},"modified":"2020-05-31T14:01:11","modified_gmt":"2020-05-31T14:01:11","slug":"html-button","status":"publish","type":"post","link":"https:\/\/www.copahost.com\/blog\/html-button\/","title":{"rendered":"HTML Button: Using buttons in a website"},"content":{"rendered":"<p>You can use an HTML button to trigger any event.\u00a0 They are important aspects of user interaction with the web site. HTML provides the button tag to create a simple button and CSS makes them look attractive. There are ways to make the button work. Buttons have a lot of attributes. This article will describe how to use some of these important attributes in HTML.<\/p>\n<h3>Topics in this article<\/h3>\n<ul>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic1\">A basic example of a HTML button\u00a0<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic2\">The onclick attribute<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic3\">Button size<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic4\">Button type<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic5\">Styling buttons<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic6\">Submit HTML button<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic7\">Disabling a button<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic8\">Buttons with bootstrap<\/a><\/li>\n<li><a href=\"https:\/\/www.copahost.com\/blog\/html-button\/#topic9\">Conclusion<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>A basic example of an HTML button<\/h3>\n<p>The following code is a basic button.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;p&gt; this is a simple button &lt;\/p&gt;\r\n&lt;button type=\"button\"&gt;Click&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1294\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b0.png\" alt=\"\" width=\"189\" height=\"88\" \/><\/p>\n<p>Like all other tags, the <a href=\"https:\/\/www.copahost.com\/blog\/html-link-tag\/\">button tag<\/a> is also placed inside the body tag. Button tag has one opening tag and one closing tag. The type of button is defined by using the type attribute. There are three values for the type attribute, button, submit and reset. However, <a href=\"https:\/\/www.copahost.com\/blog\/html-form\/\">submit and reset are used while creating a form<\/a>. The text written between the tags appears on the button.<br \/>\n<a id=\"topic2\"><\/a><\/p>\n<h3>onclick attribute<\/h3>\n<p>We used a button tag to create a button. But what happens when this button is clicked? absolutely nothing. To make this button work, We can use the onclick attribute of the button tag.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt; \r\n&lt;body&gt; \r\n&lt;button type=\"button\" onclick=\"alert('Hello world!')\"&gt;Click&lt;\/button&gt; \r\n&lt;\/body&gt; \r\n&lt;\/html&gt;<\/pre>\n<p>In the above example, whenever a user clicks the button, an alert message appears. In the place of an alert message, we can also place a <a href=\"https:\/\/www.copahost.com\/blog\/javascript-parsefloat\/\">javascript function<\/a>. We can decide what to do in this javascript function.<\/p>\n<p>Before clicking the button.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1290\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b1.png\" alt=\"\" width=\"86\" height=\"61\" \/><\/p>\n<p>After the button is clicked, an alert message with &#8220;Hello world!&#8221; appears on the screen.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-1291 size-full\" style=\"border: 1px solid black;\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b2-1.png\" alt=\"\" width=\"552\" height=\"148\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b2-1.png 552w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b2-1-300x80.png 300w\" sizes=\"(max-width: 552px) 100vw, 552px\" \/><\/p>\n<p>onclick attribute can also be used with the button tag to make it work as a <a href=\"https:\/\/www.copahost.com\/blog\/html-link\/\">link<\/a>. The following code has a button. When clicked, it opens the homepage of google.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt; \r\n&lt;body&gt; \r\n&lt;button type=\"button\" onclick=\"window.location.href = 'https:\/\/www.google.com\/';\"&gt;Click&lt;\/button&gt; \r\n&lt;\/body&gt; \r\n&lt;\/html&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h3>Button size<\/h3>\n<p>In the above examples, we can see a normal-sized button. There are few ways of increasing the button size. We can use the font-size property of CSS to increase the size of the button, or we can also use the padding property of CSS. The following example uses the font-size property to increase the size of the button.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;button type=\"button\" style=\"font-size: 20px\"&gt;Click&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>As you can see, the font-size is given twenty pixels. This will increase the size of the button according to the size of the text written inside the button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1288\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b3.png\" alt=\"\" width=\"91\" height=\"58\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b3.png 91w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b3-84x55.png 84w\" sizes=\"(max-width: 91px) 100vw, 91px\" \/><\/p>\n<p>Another way is to use the padding property.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;button type=\"button\" style=\"padding: 20px\"&gt;Click&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Here, We have set the padding to twenty pixels. Space between the text and the walls of the button will be twenty pixels.<\/p>\n<h4><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1287\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b4.png\" alt=\"\" width=\"112\" height=\"88\" \/><\/h4>\n<p>&nbsp;<\/p>\n<h3>Button type<\/h3>\n<p>As I mentioned earlier, there are three values we can give to the type attribute of the button.<\/p>\n<p>1.Button: When we want to use a standard button, we have to give &#8220;button&#8221; as the value of type attribute.<\/p>\n<p>2. Submit: The <a href=\"https:\/\/www.copahost.com\/blog\/html-comments\/\">HTML form tag<\/a> has data inside it. We use the type as &#8220;submit&#8221; to submit the form-data. URL entered in the action attribute of form tag is the place where data is submitted. The following code has a form with submit button.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;form action=\"\/action_page.php\" method=\"get\" id=\"nameform\"&gt;\r\n  First name: &lt;input type=\"text\" name=\"fname\"&gt;&lt;br&gt;\r\n  Last name: &lt;input type=\"text\" name=\"lname\"&gt;&lt;br&gt;\r\n&lt;\/form&gt;\r\n&lt;button type=\"submit\" form=\"nameform\" value=\"Submit\"&gt;Submit&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>3. Reset: We can also reset the data of a form to its initial values. To do this, &#8220;reset&#8221; is given as the value of type attribute. The following code has initial values in input fields. We can change the values and then press the reset button to get the initial values inside the input fields. The following code has a form with a reset button.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt; \r\n&lt;body&gt; \r\n&lt;form action=\"\/action_page.php\" method=\"get\" id=\"nameform\"&gt;\r\nFirst name: &lt;input type=\"text\" name=\"fname\" value=\"john\"&gt;&lt;br&gt; \r\nLast name: &lt;input type=\"text\" name=\"lname\" value=\"potter\"&gt;&lt;br&gt; \r\n&lt;\/form&gt; \r\n&lt;button type=\"reset\" form=\"nameform\" &gt;Reset&lt;\/button&gt;\r\n&lt;\/body&gt; \r\n&lt;\/html&gt;<\/pre>\n<p>&nbsp;<\/p>\n<h3>Styling buttons<\/h3>\n<p>A normal HTML button looks dull. But CSS provides many options to style a button. We can change the <a href=\"https:\/\/www.copahost.com\/blog\/font-color-html\/\">color<\/a>, font size, border color, border-radius, etc, of buttons using CSS. I will explain some ways of making a button look better.<\/p>\n<p>The color of the button can be changed using the background-color property of CSS. The following code shows three buttons with three different colors.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;button type=\"button\" style=\"background-color: green; font-size: 50px\"&gt;Green&lt;\/button&gt;\r\n&lt;button type=\"button\" style=\"background-color: blue; font-size: 50px\"&gt;Blue&lt;\/button&gt;\r\n&lt;button type=\"button\" style=\"background-color: red; font-size: 50px\"&gt;Red&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1286\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b5.png\" alt=\"\" width=\"492\" height=\"93\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b5.png 492w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b5-300x57.png 300w\" sizes=\"(max-width: 492px) 100vw, 492px\" \/><\/p>\n<p>We can use the border attribute of CSS to specify the size, style, and color of a button. The following code shows three buttons with three different border colors.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;button type=\"button\" style=\"border: 5px solid green; font-size: 50px\"&gt;Green&lt;\/button&gt;\r\n&lt;button type=\"button\" style=\"border: 5px solid blue; font-size: 50px\"&gt;Blue&lt;\/button&gt;\r\n&lt;button type=\"button\" style=\"border: 5px solid red; font-size: 50px\"&gt;Red&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Observe the value given in the border property carefully. &#8220;5px&#8221; defines the size of border. Solid is the style, followed by the color of the border. Instead of solid, there are also few other options for border style, like dotted, dashed, groove, etc.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1285\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b6.png\" alt=\"\" width=\"516\" height=\"101\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b6.png 516w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b6-300x59.png 300w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b6-510x101.png 510w\" sizes=\"(max-width: 516px) 100vw, 516px\" \/><\/p>\n<p>Usually, a button has a sharp corner. We can make these corner rounded by using the border-radius property of CSS. The following code shows three buttons with rounded corners.<\/p>\n<pre class=\"lang:default decode:true\">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;button type=\"button\" style=\"border: 5px solid green;border-radius: 20px;font-size: 50px\"&gt;Green&lt;\/button&gt;\r\n&lt;button type=\"button\" style=\"border: 5px solid blue;border-radius: 20px; font-size: 50px\"&gt;Blue&lt;\/button&gt;\r\n&lt;button type=\"button\" style=\"border: 5px solid red;border-radius: 20px; font-size: 50px\"&gt;Red&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h4><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1284\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b7.png\" alt=\"\" width=\"519\" height=\"94\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b7.png 519w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b7-300x54.png 300w\" sizes=\"(max-width: 519px) 100vw, 519px\" \/><\/h4>\n<p>&nbsp;<\/p>\n<h3>Action<\/h3>\n<p>Action is an attribute of the form <a href=\"https:\/\/www.copahost.com\/blog\/meta-tags-html\/\">tag in HTML<\/a>. The action attribute specifies where to send the form data. To use the action attribute, the type of the button should be &#8220;submit&#8221;.<\/p>\n<p>The following <a href=\"https:\/\/www.copahost.com\/blog\/did-you-know-that-when-you-confirm-your-identity-through-a-captcha-code-you-are-helping-to-create-the-largest-digital-library-of-the-world\/\">code creates<\/a> a form with two input fields and a submit button. The value of the action attribute should be the URL where the data is to be sent.<\/p>\n<pre class=\"lang:default decode:true \">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;form action=\"\/action_page.php\"&gt;\r\nFirst name: &lt;input type=\"text\" name=\"FirstName\" value=\"Mickey\"&gt;&lt;br&gt;\r\nLast name: &lt;input type=\"text\" name=\"LastName\" value=\"Mouse\"&gt;&lt;br&gt;\r\n&lt;button type=\"submit\"&gt;Submit&lt;\/button&gt;\r\n&lt;\/form&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h4><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1283\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b8.png\" alt=\"\" width=\"318\" height=\"97\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b8.png 318w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b8-300x92.png 300w\" sizes=\"(max-width: 318px) 100vw, 318px\" \/><\/h4>\n<p>&nbsp;<\/p>\n<h3>Disabling a button<\/h3>\n<p>A button is always active by default. This means, all the time it is clickable. We can make a button non-clickable by using the disabled attribute of the button tag. The disabled attribute is a boolean attribute. The following code shows two buttons, one which is clickable and the second one which is not clickable.<\/p>\n<pre class=\"lang:default decode:true \">&lt;html&gt;\r\n&lt;body&gt;\r\n&lt;p&gt; this button is clickable &lt;\/p&gt;\r\n&lt;button type=\"button\"&gt;Click Me!&lt;\/button&gt;\r\n&lt;p&gt; this button is not clickable &lt;\/p&gt;a\r\n&lt;button type=\"button\" disabled&gt;Click Me!&lt;\/button&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h4><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1282\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b9.png\" alt=\"\" width=\"226\" height=\"191\" \/><\/h4>\n<p>&nbsp;<\/p>\n<h3>Buttons with bootstrap<\/h3>\n<p>Apart from CSS, we can use <a href=\"https:\/\/getbootstrap.com\/docs\/4.3\/components\/buttons\/\" target=\"_blank\" rel=\"noopener noreferrer\">bootstrap<\/a> to make buttons look better and attractive. Bootstrap provides many classes to modify a button.\u00a0 We can change the color of the button and the size with bootstrap classes. The following code has all the button styles that are provided by bootstrap.<\/p>\n<pre class=\"lang:default decode:true\">&lt;body&gt;\r\n&lt;button type=\"button\" class=\"btn\"&gt;Basic&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-default\"&gt;Default&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-primary\"&gt;Primary&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-success\"&gt;Success&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-info\"&gt;Info&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-warning\"&gt;Warning&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-danger\"&gt;Danger&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-link\"&gt;Link&lt;\/button&gt;      \r\n&lt;\/body&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1281\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b10.png\" alt=\"\" width=\"709\" height=\"73\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b10.png 709w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b10-300x31.png 300w\" sizes=\"(max-width: 709px) 100vw, 709px\" \/><\/p>\n<p>btn is the class for the basic bootstrap button.<\/p>\n<p>We can also change the size of buttons using bootstrap classes. The following code has all the size classes that are provided by bootstrap.<\/p>\n<pre class=\"lang:default decode:true \">&lt;button type=\"button\" class=\"btn btn-primary btn-lg\"&gt;Large&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-primary btn-md\"&gt;Medium&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-primary btn-sm\"&gt;Small&lt;\/button&gt;\r\n&lt;button type=\"button\" class=\"btn btn-primary btn-xs\"&gt;XSmall&lt;\/button&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1280 size-full\" src=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b11.png\" alt=\"html button\" width=\"375\" height=\"89\" srcset=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b11.png 375w, https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/b11-300x71.png 300w\" sizes=\"(max-width: 375px) 100vw, 375px\" \/><br \/>\n<a id=\"topic9\"><\/a><\/p>\n<h3>Conclusion<\/h3>\n<p>Buttons are very helpful for user interaction. A well-performing button is created by using HTML, CSS, and Javascript. Many options are provided by HTML to work with buttons. All you need is to learn every aspect of it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use an HTML button to trigger any event.\u00a0 They are important aspects of user interaction with the web site. HTML provides the button tag to create a simple button and CSS makes them look attractive. There are ways to make the button work. Buttons have a lot of attributes. This article will describe [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2005,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1276","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTML Button: Using buttons in a website - Copahost<\/title>\n<meta name=\"description\" content=\"All about the HTML button. How to change its size, style, CSS, action. How to submit a form, or trigger a javascript function and much more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.copahost.com\/blog\/html-button\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML Button: Using buttons in a website - Copahost\" \/>\n<meta property=\"og:description\" content=\"All about the HTML button. How to change its size, style, CSS, action. How to submit a form, or trigger a javascript function and much more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.copahost.com\/blog\/html-button\/\" \/>\n<meta property=\"og:site_name\" content=\"Copahost\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-18T21:30:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-31T14:01:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Gustavo Gallas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Gustavo Gallas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/\"},\"author\":{\"name\":\"Gustavo Gallas\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/386b3f1f79299d43f4ceb33d26428246\"},\"headline\":\"HTML Button: Using buttons in a website\",\"datePublished\":\"2019-07-18T21:30:24+00:00\",\"dateModified\":\"2020-05-31T14:01:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/\"},\"wordCount\":998,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.copahost.com\/blog\/html-button\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/html-button\/\",\"name\":\"HTML Button: Using buttons in a website - Copahost\",\"isPartOf\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg\",\"datePublished\":\"2019-07-18T21:30:24+00:00\",\"dateModified\":\"2020-05-31T14:01:11+00:00\",\"description\":\"All about the HTML button. How to change its size, style, CSS, action. How to submit a form, or trigger a javascript function and much more.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.copahost.com\/blog\/html-button\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg\",\"width\":1200,\"height\":628},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.copahost.com\/blog\/html-button\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.copahost.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML Button: Using buttons in a website\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#website\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"name\":\"Copahost\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.copahost.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#organization\",\"name\":\"Copahost\",\"url\":\"https:\/\/www.copahost.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"contentUrl\":\"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png\",\"width\":223,\"height\":40,\"caption\":\"Copahost\"},\"image\":{\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/386b3f1f79299d43f4ceb33d26428246\",\"name\":\"Gustavo Gallas\",\"description\":\"Graduated in Computing at PUC-Rio, Brazil. Specialized in IT, networking, systems administration and human and organizational development\u200b. Also have brewing skills.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/gustavo-gallas-107926196\/\"],\"url\":\"https:\/\/www.copahost.com\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML Button: Using buttons in a website - Copahost","description":"All about the HTML button. How to change its size, style, CSS, action. How to submit a form, or trigger a javascript function and much more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.copahost.com\/blog\/html-button\/","og_locale":"en_US","og_type":"article","og_title":"HTML Button: Using buttons in a website - Copahost","og_description":"All about the HTML button. How to change its size, style, CSS, action. How to submit a form, or trigger a javascript function and much more.","og_url":"https:\/\/www.copahost.com\/blog\/html-button\/","og_site_name":"Copahost","article_published_time":"2019-07-18T21:30:24+00:00","article_modified_time":"2020-05-31T14:01:11+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg","type":"image\/jpeg"}],"author":"Gustavo Gallas","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Gustavo Gallas","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.copahost.com\/blog\/html-button\/#article","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/html-button\/"},"author":{"name":"Gustavo Gallas","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/386b3f1f79299d43f4ceb33d26428246"},"headline":"HTML Button: Using buttons in a website","datePublished":"2019-07-18T21:30:24+00:00","dateModified":"2020-05-31T14:01:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/html-button\/"},"wordCount":998,"commentCount":0,"publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.copahost.com\/blog\/html-button\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.copahost.com\/blog\/html-button\/","url":"https:\/\/www.copahost.com\/blog\/html-button\/","name":"HTML Button: Using buttons in a website - Copahost","isPartOf":{"@id":"https:\/\/www.copahost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage"},"thumbnailUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg","datePublished":"2019-07-18T21:30:24+00:00","dateModified":"2020-05-31T14:01:11+00:00","description":"All about the HTML button. How to change its size, style, CSS, action. How to submit a form, or trigger a javascript function and much more.","breadcrumb":{"@id":"https:\/\/www.copahost.com\/blog\/html-button\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.copahost.com\/blog\/html-button\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/html-button\/#primaryimage","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2019\/07\/html-button.jpg","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/www.copahost.com\/blog\/html-button\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.copahost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"HTML Button: Using buttons in a website"}]},{"@type":"WebSite","@id":"https:\/\/www.copahost.com\/blog\/#website","url":"https:\/\/www.copahost.com\/blog\/","name":"Copahost","description":"","publisher":{"@id":"https:\/\/www.copahost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.copahost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.copahost.com\/blog\/#organization","name":"Copahost","url":"https:\/\/www.copahost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","contentUrl":"https:\/\/www.copahost.com\/blog\/wp-content\/uploads\/2016\/03\/copahostlogo.png","width":223,"height":40,"caption":"Copahost"},"image":{"@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.copahost.com\/blog\/#\/schema\/person\/386b3f1f79299d43f4ceb33d26428246","name":"Gustavo Gallas","description":"Graduated in Computing at PUC-Rio, Brazil. Specialized in IT, networking, systems administration and human and organizational development\u200b. Also have brewing skills.","sameAs":["https:\/\/www.linkedin.com\/in\/gustavo-gallas-107926196\/"],"url":"https:\/\/www.copahost.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/1276","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/comments?post=1276"}],"version-history":[{"count":21,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/1276\/revisions"}],"predecessor-version":[{"id":2437,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/posts\/1276\/revisions\/2437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media\/2005"}],"wp:attachment":[{"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/media?parent=1276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/categories?post=1276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.copahost.com\/blog\/wp-json\/wp\/v2\/tags?post=1276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}