{"id":1516,"date":"2024-11-28T15:13:04","date_gmt":"2024-11-28T15:13:04","guid":{"rendered":"https:\/\/donhit.com\/en\/?p=1516"},"modified":"2025-02-07T09:24:04","modified_gmt":"2025-02-07T09:24:04","slug":"square-footage","status":"publish","type":"post","link":"https:\/\/donhit.com\/en\/calculator\/square-footage\/","title":{"rendered":"Square Footage Calculator"},"content":{"rendered":"<p><center><div class=\"calculator\">\r\n        <h2>Square Footage Calculator<\/h2>\r\n        \r\n        <div class=\"unit-selector\">\r\n            <button onclick=\"setUnit('rectangle')\" class=\"active\">Rectangle<\/button>\r\n            <button onclick=\"setUnit('circle')\">Circle<\/button>\r\n            <button onclick=\"setUnit('triangle')\">Triangle<\/button>\r\n        <\/div>\r\n        \r\n        <div id=\"rectangleInputs\" class=\"inputs\">\r\n            <div class=\"input-group\">\r\n                <label>Length (feet)<\/label>\r\n                <input type=\"number\" id=\"rectangleLength\" placeholder=\"Enter length\">\r\n            <\/div>\r\n            <div class=\"input-group\">\r\n                <label>Width (feet)<\/label>\r\n                <input type=\"number\" id=\"rectangleWidth\" placeholder=\"Enter width\">\r\n            <\/div>\r\n        <\/div>\r\n        \r\n        <div id=\"circleInputs\" class=\"inputs\" style=\"display:none;\">\r\n            <div class=\"input-group\">\r\n                <label>Radius (feet)<\/label>\r\n                <input type=\"number\" id=\"circleRadius\" placeholder=\"Enter radius\">\r\n            <\/div>\r\n        <\/div>\r\n        \r\n        <div id=\"triangleInputs\" class=\"inputs\" style=\"display:none;\">\r\n            <div class=\"input-group\">\r\n                <label>Base (feet)<\/label>\r\n                <input type=\"number\" id=\"triangleBase\" placeholder=\"Enter base\">\r\n            <\/div>\r\n            <div class=\"input-group\">\r\n                <label>Height (feet)<\/label>\r\n                <input type=\"number\" id=\"triangleHeight\" placeholder=\"Enter height\">\r\n            <\/div>\r\n        <\/div>\r\n        \r\n        <button id=\"calculateBtn\" onclick=\"calculate()\">Calculate Square Footage<\/button>\r\n        \r\n        <div id=\"result\"><\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        let currentUnit = 'rectangle';\r\n\r\n        function setUnit(unit) {\r\n            currentUnit = unit;\r\n            document.querySelectorAll('.inputs').forEach(inputs => {\r\n                inputs.style.display = 'none';\r\n            });\r\n            document.querySelectorAll('.unit-selector button').forEach(btn => {\r\n                btn.classList.remove('active');\r\n            });\r\n            \r\n            document.getElementById(`${unit}Inputs`).style.display = 'block';\r\n            event.target.classList.add('active');\r\n        }\r\n\r\n        function calculate() {\r\n            let area = 0;\r\n            const resultDiv = document.getElementById('result');\r\n\r\n            switch(currentUnit) {\r\n                case 'rectangle':\r\n                    const length = parseFloat(document.getElementById('rectangleLength').value);\r\n                    const width = parseFloat(document.getElementById('rectangleWidth').value);\r\n                    \r\n                    if (isNaN(length) || isNaN(width)) {\r\n                        resultDiv.textContent = 'Please enter valid numbers';\r\n                        return;\r\n                    }\r\n                    \r\n                    area = length * width;\r\n                    break;\r\n\r\n                case 'circle':\r\n                    const radius = parseFloat(document.getElementById('circleRadius').value);\r\n                    \r\n                    if (isNaN(radius)) {\r\n                        resultDiv.textContent = 'Please enter a valid radius';\r\n                        return;\r\n                    }\r\n                    \r\n                    area = Math.PI * radius * radius;\r\n                    break;\r\n\r\n                case 'triangle':\r\n                    const base = parseFloat(document.getElementById('triangleBase').value);\r\n                    const height = parseFloat(document.getElementById('triangleHeight').value);\r\n                    \r\n                    if (isNaN(base) || isNaN(height)) {\r\n                        resultDiv.textContent = 'Please enter valid numbers';\r\n                        return;\r\n                    }\r\n                    \r\n                    area = 0.5 * base * height;\r\n                    break;\r\n            }\r\n\r\n            resultDiv.textContent = `Area: ${area.toFixed(2)} sq ft`;\r\n        }\r\n    <\/script><\/center>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[184],"tags":[],"class_list":["post-1516","post","type-post","status-publish","format-standard","hentry","category-calculator"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Square Footage Calculator - DonHit<\/title>\n<meta name=\"description\" content=\"Square footage calculators simplify the process of determining room dimensions and total area, making them invaluable for construction planning and home improvement projects\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/donhit.com\/en\/calculator\/square-footage\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Square Footage Calculator - DonHit\" \/>\n<meta property=\"og:description\" content=\"Square footage calculators simplify the process of determining room dimensions and total area, making them invaluable for construction planning and home improvement projects\" \/>\n<meta property=\"og:url\" content=\"https:\/\/donhit.com\/en\/calculator\/square-footage\/\" \/>\n<meta property=\"og:site_name\" content=\"DonHit - World of Tools\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-28T15:13:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-07T09:24:04+00:00\" \/>\n<meta name=\"author\" content=\"DonHit\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DonHit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Square Footage Calculator - DonHit","description":"Square footage calculators simplify the process of determining room dimensions and total area, making them invaluable for construction planning and home improvement projects","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:\/\/donhit.com\/en\/calculator\/square-footage\/","og_locale":"en_US","og_type":"article","og_title":"Square Footage Calculator - DonHit","og_description":"Square footage calculators simplify the process of determining room dimensions and total area, making them invaluable for construction planning and home improvement projects","og_url":"https:\/\/donhit.com\/en\/calculator\/square-footage\/","og_site_name":"DonHit - World of Tools","article_published_time":"2024-11-28T15:13:04+00:00","article_modified_time":"2025-02-07T09:24:04+00:00","author":"DonHit","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DonHit","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/donhit.com\/en\/calculator\/square-footage\/#article","isPartOf":{"@id":"https:\/\/donhit.com\/en\/calculator\/square-footage\/"},"author":{"name":"DonHit","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"headline":"Square Footage Calculator","datePublished":"2024-11-28T15:13:04+00:00","dateModified":"2025-02-07T09:24:04+00:00","mainEntityOfPage":{"@id":"https:\/\/donhit.com\/en\/calculator\/square-footage\/"},"wordCount":10,"commentCount":0,"publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"articleSection":["Calculator"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/donhit.com\/en\/calculator\/square-footage\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/donhit.com\/en\/calculator\/square-footage\/","url":"https:\/\/donhit.com\/en\/calculator\/square-footage\/","name":"Square Footage Calculator - DonHit","isPartOf":{"@id":"https:\/\/donhit.com\/en\/#website"},"datePublished":"2024-11-28T15:13:04+00:00","dateModified":"2025-02-07T09:24:04+00:00","description":"Square footage calculators simplify the process of determining room dimensions and total area, making them invaluable for construction planning and home improvement projects","breadcrumb":{"@id":"https:\/\/donhit.com\/en\/calculator\/square-footage\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/donhit.com\/en\/calculator\/square-footage\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/donhit.com\/en\/calculator\/square-footage\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Trang ch\u1ee7","item":"https:\/\/donhit.com\/en\/"},{"@type":"ListItem","position":2,"name":"Calculator","item":"https:\/\/donhit.com\/en\/category\/calculator\/"},{"@type":"ListItem","position":3,"name":"Square Footage Calculator"}]},{"@type":"WebSite","@id":"https:\/\/donhit.com\/en\/#website","url":"https:\/\/donhit.com\/en\/","name":"DonHit - World of tools","description":"","publisher":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/donhit.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/0c6ff7dcd8ba4810c56a532f09c33148","name":"DonHit","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","contentUrl":"https:\/\/donhit.com\/en\/wp-content\/uploads\/2024\/11\/logo-donhit.webp","width":400,"height":267,"caption":"DonHit"},"logo":{"@id":"https:\/\/donhit.com\/en\/#\/schema\/person\/image\/"},"description":"DonHit is a website designed to provide useful tools for everyone. Its primary goal is to support and empower the community. All the tools available on the site are completely free to use.","sameAs":["https:\/\/donhit.com\/en"],"url":"https:\/\/donhit.com\/en\/author\/admin_don\/"}]}},"_links":{"self":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/comments?post=1516"}],"version-history":[{"count":3,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1516\/revisions"}],"predecessor-version":[{"id":2182,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/posts\/1516\/revisions\/2182"}],"wp:attachment":[{"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/media?parent=1516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/categories?post=1516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donhit.com\/en\/wp-json\/wp\/v2\/tags?post=1516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}