{"id":5126,"date":"2019-10-16T17:18:29","date_gmt":"2019-10-16T11:48:29","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=5126"},"modified":"2026-11-16T13:01:23","modified_gmt":"2026-11-16T07:31:23","slug":"how-to-change-css-property-using-onclick","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-change-css-property-using-onclick\/","title":{"rendered":"How to Change CSS Property Using onclick in JavaScript"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Post Date: October 16, 2019<br>Last Updated: November 04, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Change CSS Property Using onclick in JavaScript to dynamically modify HTML element styles, button colors, and CSS classes based on user interactions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript allows developers to change the appearance and behavior of HTML elements dynamically. One common example is changing an element&#8217;s CSS properties when a user clicks a button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>onclick<\/code> event in JavaScript executes a function when an element is clicked. By combining <code>onclick<\/code> with JavaScript DOM methods, you can change an element&#8217;s background color, text color, font size, dimensions, and other CSS properties.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we will learn how to change CSS properties using the <code>onclick<\/code> event. We will also see how to apply CSS classes dynamically using JavaScript.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is the onclick Event in JavaScript?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>onclick<\/code> event is a JavaScript event that occurs when a user clicks an HTML element, such as a button, link, or image.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the <code>onclick<\/code> attribute to call a JavaScript function when the click event occurs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax:<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;element onclick=\"functionName()\">Click Me&lt;\/element><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the user clicks the element, the specified JavaScript function is executed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Change CSS Properties Using onclick<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s create a simple example in which a button changes its background color from red to green when clicked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Create the HTML Structure<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">First, create an HTML button and assign it an ID. We will use this ID to access the button through JavaScript.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n    &lt;title>Change CSS Property Using onclick&lt;\/title>\n&lt;\/head>\n&lt;body>\n\n    &lt;h2>Change CSS Property Using JavaScript&lt;\/h2>\n\n    &lt;button id=\"mybutton\" onclick=\"myFunction()\">\n        OK\n    &lt;\/button>\n\n&lt;\/body>\n&lt;\/html><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>&lt;button><\/code> element creates a clickable button.<\/li>\n\n\n\n<li>The <code>id=\"mybutton\"<\/code> attribute identifies the button.<\/li>\n\n\n\n<li>The <code>onclick=\"myFunction()\"<\/code> attribute calls the JavaScript function when the button is clicked.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Define CSS Classes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now, create two CSS classes to define the button&#8217;s appearance.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The first class, <code>.change_red<\/code>, displays the button with a red background. The second class, <code>.change_green<\/code>, displays it with a green background.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">.change_red {\n    font-size: 20px;\n    color: white;\n    width: 13pc;\n    height: 2pc;\n    background-color: red;\n    padding: 5px;\n    border: 1px solid black;\n    border-radius: 3px;\n}\n\n.change_green {\n    font-size: 20px;\n    color: white;\n    width: 13pc;\n    height: 2pc;\n    background-color: green;\n    padding: 5px;\n    border: 1px solid black;\n    border-radius: 3px;\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Add the JavaScript Function<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the <code>document.getElementById()<\/code> method to access the button and change its CSS class.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function myFunction() {\n    document.getElementById(\"mybutton\").className = \"change_green\";\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here is how the code works:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>document.getElementById(\"mybutton\")<\/code> selects the button using its ID.<\/li>\n\n\n\n<li><code>.className<\/code> accesses the element&#8217;s CSS class.<\/li>\n\n\n\n<li><code>\"change_green\"<\/code> replaces the existing class with the new class.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">When the user clicks the button, its background changes from red to green.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Complete HTML, CSS, and JavaScript Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The following is the complete working example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n    &lt;title>Change CSS Property Using onclick&lt;\/title>\n\n    &lt;style>\n        .change_red {\n            font-size: 20px;\n            color: white;\n            width: 13pc;\n            height: 2pc;\n            background-color: red;\n            padding: 5px;\n            border: 1px solid black;\n            border-radius: 3px;\n        }\n\n        .change_green {\n            font-size: 20px;\n            color: white;\n            width: 13pc;\n            height: 2pc;\n            background-color: green;\n            padding: 5px;\n            border: 1px solid black;\n            border-radius: 3px;\n        }\n    &lt;\/style>\n&lt;\/head>\n\n&lt;body>\n\n    &lt;center>\n        &lt;h2>JavaScript CSS Property Example&lt;\/h2>\n\n        &lt;button\n            class=\"change_red\"\n            onclick=\"myFunction()\"\n            id=\"mybutton\">\n            OK\n        &lt;\/button>\n    &lt;\/center>\n\n    &lt;script>\n        function myFunction() {\n            document.getElementById(\"mybutton\").className = \"change_green\";\n        }\n    &lt;\/script>\n\n&lt;\/body>\n&lt;\/html><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Output:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before clicking the OK button, the button appears with a red background.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After clicking the OK button, the JavaScript function executes and changes the button&#8217;s background to green.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094613.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"757\" height=\"405\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094613.png\" alt=\"Before Click: JavaScript CSS property example showing an OK button with a red background before clicking.\" class=\"wp-image-12890\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094613.png 757w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094613-300x161.png 300w\" sizes=\"(max-width: 757px) 100vw, 757px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094619.png\"><img decoding=\"async\" width=\"758\" height=\"355\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094619.png\" alt=\"After Click: JavaScript onclick event example showing the OK button with a green background after changing its CSS property.\" class=\"wp-image-12891\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094619.png 758w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094619-300x141.png 300w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Alternative Method: Change CSS Properties Directly Using onclick<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can also change individual CSS properties without creating separate CSS classes. JavaScript provides the <code>style<\/code> property to modify an element&#8217;s inline CSS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n    &lt;title>Change CSS Style Using onclick&lt;\/title>\n&lt;\/head>\n\n&lt;body>\n\n    &lt;button id=\"mybutton\" onclick=\"changeColor()\">\n        Change Color\n    &lt;\/button>\n\n    &lt;script>\n        function changeColor() {\n            const button = document.getElementById(\"mybutton\");\n\n            button.style.backgroundColor = \"green\";\n            button.style.color = \"white\";\n            button.style.fontSize = \"20px\";\n            button.style.padding = \"10px\";\n        }\n    &lt;\/script>\n\n&lt;\/body>\n&lt;\/html><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, the <code>style<\/code> property changes individual CSS properties when the button is clicked.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use this approach when you only need to modify a few styles dynamically.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094912.png\"><img decoding=\"async\" width=\"320\" height=\"76\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094912.png\" alt=\"Before Click: JavaScript button example displaying the default Change Color button before the onclick event is triggered.\" class=\"wp-image-12892\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094912.png 320w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094912-300x71.png 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094907.png\"><img loading=\"lazy\" decoding=\"async\" width=\"443\" height=\"143\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094907.png\" alt=\"After Click: JavaScript onclick example showing the Change Color button with a green background after clicking.\" class=\"wp-image-12893\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094907.png 443w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-094907-300x97.png 300w\" sizes=\"(max-width: 443px) 100vw, 443px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Using classList to Change CSS Classes<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Another way to change an element&#8217;s CSS class is by using the JavaScript <code>classList<\/code> property.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>classList.add()<\/code> method adds a CSS class without replacing the element&#8217;s existing classes.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n    &lt;title>Change CSS Class Using classList&lt;\/title>\n\n    &lt;style>\n        .change_red {\n            background-color: red;\n            color: white;\n            padding: 10px 20px;\n        }\n\n        .change_green {\n            background-color: green;\n            color: white;\n            padding: 10px 20px;\n        }\n    &lt;\/style>\n&lt;\/head>\n\n&lt;body>\n\n    &lt;button id=\"mybutton\" class=\"change_red\" onclick=\"myFunction()\">\n        OK\n    &lt;\/button>\n\n    &lt;script>\n        function myFunction() {\n            const button = document.getElementById(\"mybutton\");\n\n            button.classList.remove(\"change_red\");\n            button.classList.add(\"change_green\");\n        }\n    &lt;\/script>\n\n&lt;\/body>\n&lt;\/html><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>classList.remove(\"change_red\")<\/code> removes the existing red class.<\/li>\n\n\n\n<li><code>classList.add(\"change_green\")<\/code> applies the green class.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Unlike assigning a new value to <code>className<\/code>, <code>classList<\/code> lets you add and remove individual classes while preserving other classes on the element.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Output:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-095218.png\"><img loading=\"lazy\" decoding=\"async\" width=\"192\" height=\"70\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-095218.png\" alt=\"Before Click: JavaScript onclick example showing an OK button with a red background before the CSS property is changed.\" class=\"wp-image-12894\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-095212.png\"><img loading=\"lazy\" decoding=\"async\" width=\"282\" height=\"75\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/Screenshot-2026-11-04-095212.png\" alt=\"After Click: JavaScript onclick example showing the OK button with a green background after the CSS property is changed.\" class=\"wp-image-12895\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript makes it easy to change CSS properties dynamically based on user interactions. By using the <code>onclick<\/code> event with DOM methods such as <code>getElementById()<\/code>, developers can update an element&#8217;s styles or CSS classes when a user clicks a button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the <code>style<\/code> property to modify individual CSS properties, <code>className<\/code> to replace an element&#8217;s class, or <code>classList<\/code> to add and remove specific classes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These techniques are useful for creating interactive buttons, dynamic forms, menus, and other user-friendly web interfaces.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. How can I change a CSS property when a button is clicked in JavaScript?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the <code>onclick<\/code> event to call a JavaScript function and update the element&#8217;s style property.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">document.getElementById(\"mybutton\").style.backgroundColor = \"green\";<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I change a CSS class using onclick?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use <code>getElementById()<\/code> to select the HTML element and update its class using <code>className<\/code> or <code>classList<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">document.getElementById(\"mybutton\").classList.add(\"change_green\");<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. Can I change multiple CSS properties using onclick?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. You can update multiple CSS properties inside a single JavaScript function using the <code>style<\/code> property.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-use-transform-property-in-css\/\">How to Use Transform Property in CSS<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Official Articles<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Element\/click_event\" target=\"_blank\" rel=\"noopener\">MDN \u2013 Element: click event<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/HTMLElement\/style\" target=\"_blank\" rel=\"noopener\">MDN \u2013 HTMLElement: style property<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Element\/classList\" target=\"_blank\" rel=\"noopener\">MDN \u2013 Element: classList property<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/EventTarget\/addEventListener\" target=\"_blank\" rel=\"noopener\">MDN \u2013 EventTarget: addEventListener()<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to Our Experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for reliable web development and JavaScript solutions?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><a href=\"https:\/\/pheonixsolutions.com\/web-development\/\">Pheonix Solutions<\/a><\/strong> provides web development services, frontend development, and custom application solutions to help businesses build interactive and user-friendly websites.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our team can help you develop responsive web applications, implement dynamic user interfaces, and create efficient digital solutions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><a href=\"https:\/\/pheonixsolutions.com\/contact\">Contact our experts<\/a><\/strong> to discuss your project requirements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: October 16, 2019Last Updated: November 04, 2026 Introduction Change CSS Property Using onclick in JavaScript to dynamically modify [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":13489,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","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":"","ast-disable-related-posts":"","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-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-opacity":"","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-opacity":"","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-opacity":"","overlay-gradient":""}},"ast-content-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-opacity":"","overlay-gradient":""},"tablet":{"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-opacity":"","overlay-gradient":""},"mobile":{"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-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[661],"class_list":["post-5126","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-architecture","tag-javascript","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1kG","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/10\/JavaScript-Onclick-CSS-Tutorial-Banner.png","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=5126"}],"version-history":[{"count":3,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5126\/revisions"}],"predecessor-version":[{"id":13491,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/5126\/revisions\/13491"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media\/13489"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=5126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=5126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=5126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}