{"id":1928,"date":"2021-06-29T19:49:57","date_gmt":"2021-06-29T14:19:57","guid":{"rendered":"https:\/\/drtktopecollege.in\/?p=1928"},"modified":"2021-06-29T19:52:48","modified_gmt":"2021-06-29T14:22:48","slug":"income-tax-calculator-2018-19","status":"publish","type":"post","link":"https:\/\/drtktopecollege.in\/?p=1928","title":{"rendered":"Income tax calculator &#8211; JavaScript"},"content":{"rendered":"\n\n\n\n\t<title>Income tax calculator<\/title>\n\t<meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\n\t<link rel=\"stylesheet\" href=\"https:\/\/www.w3schools.com\/w3css\/4\/w3.css\">\n\n\t<style>\n\t\tbody{\n\t\t\tmargin:10%;\n\t\t\tfont-family: garmond;\n\t\t\tfont-size: 16pt;\n\t\t\ttext-align: left;\n\t\t}\n\t\t.rule{\n\n\t\t\tcolor: blue;\n\t\t\tfont-weight: bold;\n\t\t}\n\n\t\ta{\n\t\t\tcolor: blue;\n\t\t}\n\t\timg{\n\n\t\t\tfloat: right;\n\t\t\tmargin:1%;\n\t\t}\n\t<\/style>\n\n\t<script>\n\n\t\n\tfunction tax(){\n\t\tvar a = document.getElementById('taxi').value;\n\t\tif (a <= 0) {\n\n\t\t\tdocument.getElementById('tax1').innerHTML = \"You are testing me.\";\n\t\t\tdocument.getElementById('tax2').innerHTML = \"Cess - Nil.\";\n\t\t\tdocument.getElementById('tax3').innerHTML = \"Total -  NA\";\n\t\t\tdocument.getElementById('tax4').innerHTML = \"Monthly installment - Nil\";\n\t\t}\n\n\n\t\telse if (a <= 250000) {\n\n\t\t\tdocument.getElementById('tax1').innerHTML = \"Tax - Nil.\";\n\t\t\tdocument.getElementById('tax2').innerHTML = \"Cess - Nil.\";\n\t\t\tdocument.getElementById('tax3').innerHTML = \"Total -  NA\";\n\t\t\tdocument.getElementById('tax4').innerHTML = \"Monthly installment - Nil\";\n\t\t}\n\t\telse if (a > 250000 && a <= 500000) {\n\n\t\t\tvar b = (((a - 250000)* 5)\/100 ) ;\n\t\t\t\n\t\t\tvar cess = b * 4 \/100 ;\n\t\t\t\n\t\t\tvar tot = b + cess;\n\t\t\t\n\t\t\tvar c = (tot \/ 12);\n\t\t\t\n\t\t\t\n\n\t\t\tdocument.getElementById('tax1').innerHTML = \"Pay tax Rs. \" + b.toFixed(2);\n\t\t\tdocument.getElementById('tax2').innerHTML = \"Pay cess (4%) Rs. \" + cess.toFixed(2);\n\t\t\tdocument.getElementById('tax3').innerHTML = \"Total = Rs. \" + tot.toFixed(2);\n\t\t\tdocument.getElementById('tax4').innerHTML = \"Monthly installment of Rs. \" + c.toFixed(2);\n\t\t}\n\n\t\telse if (a > 500000 && a <= 1000000){\n\t\t\tvar b = (a - 500000)* 20 \/ 100 + 12500;\n\t\t\tvar cess = b * 4 \/100 ;\n\t\t\t\/\/var cessf = num.toFixed(cess);\n\t\t\tvar tot = b + cess;\n\t\t\t\/\/var totf = num.toFixed(tot);\n\t\t\tvar c = tot \/ 12;\n\t\t\t\n\t\t\t\n\t\t\tdocument.getElementById('tax1').innerHTML = \"Pay tax Rs. \" + b.toFixed(2);\n\t\t\tdocument.getElementById('tax2').innerHTML = \"Pay cess (4%) Rs. \" + cess.toFixed(2);\n\t\t\tdocument.getElementById('tax3').innerHTML = \"Total = Rs. \" + tot.toFixed(2);\n\t\t\tdocument.getElementById('tax4').innerHTML = \"Monthly installment of Rs. \" + c.toFixed(2);\n\t\t}\n\n\t\telse if (a > 100000) {\n\n\t\t\tvar b = (a - 1000000) * 30 \/ 100 + 112500;\n\t\t\tvar cess = b * 4 \/100 ;\n\t\t\t\n\t\t\tvar tot = b + cess;\n\t\t\t\n\t\t\tvar c = tot \/ 12;\n\t\t\t\n\n\t\t\tdocument.getElementById('tax1').innerHTML = \"Pay tax Rs. \" + b.toFixed(2);\n\t\t\t\n\t\t\tdocument.getElementById('tax2').innerHTML = \"Pay cess (4%) Rs. \" + cess.toFixed(2);\n\t\t\tdocument.getElementById('tax3').innerHTML = \"Total = Rs. \" + tot.toFixed(2);\n\t\t\tdocument.getElementById('tax4').innerHTML = \"Monthly installment of Rs. \" + c.toFixed(2);\n\n\t\t}\n\t\t\n\n\t}\nfunction myFunction() {\n  location.reload();\n}\n\n<\/script>\n\n\n\n\n\n\t<p><\/p><h2>Income tax calculator &#8211; Financial year 2018-19<\/h2><p><\/p>\n\n\n<label>Enter your taxable annual income :-<\/label>\n<p><\/p><input type=\"number\" name=\"ti\" id=\"taxi\"><p><\/p>\n\n<button id=\"taxsub\" onclick=\"tax()\">Submit<\/button>\n\n\n<script>\n\tvar input = document.getElementById(\"taxi\");\n\tinput.addEventListener(\"keyup\", function(event) {\n  if (event.keyCode === 13) {\n   event.preventDefault();\n   document.getElementById(\"taxsub\").click();\n  }\n});\n\n<\/script>\n\n<button onclick=\"myFunction()\">Reset<\/button>\n\n\n\n<p id=\"tax1\"><\/p>\n<p id=\"tax2\"><\/p>\n<p id=\"tax3\"><\/p>\n<p id=\"tax4\"><\/p>\n\n<p>Be assured.  Nothing is uploaded on the server.  Calculations done in your browser.<\/p>\n\n\n\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Income tax calculator Income tax calculator &#8211; Financial year 2018-19 Enter your taxable annual income :- Submit Reset Be assured. Nothing is uploaded on the server. Calculations done in your browser.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[40],"tags":[],"class_list":["post-1928","post","type-post","status-publish","format-standard","hentry","category-microsoft-excel"],"_links":{"self":[{"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=\/wp\/v2\/posts\/1928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1928"}],"version-history":[{"count":3,"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=\/wp\/v2\/posts\/1928\/revisions"}],"predecessor-version":[{"id":1933,"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=\/wp\/v2\/posts\/1928\/revisions\/1933"}],"wp:attachment":[{"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drtktopecollege.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}