{"id":24,"date":"2025-12-25T15:39:13","date_gmt":"2025-12-25T14:39:13","guid":{"rendered":"https:\/\/simulios.fr\/?page_id=24"},"modified":"2025-12-26T13:17:55","modified_gmt":"2025-12-26T12:17:55","slug":"calculateur","status":"publish","type":"page","link":"https:\/\/simulios.fr\/?page_id=24","title":{"rendered":"Calculateur"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"24\" class=\"elementor elementor-24\">\n\t\t\t\t<div class=\"elementor-element elementor-element-d655303 e-flex e-con-boxed e-con e-parent\" data-id=\"d655303\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-10f4e5b elementor-widget elementor-widget-html\" data-id=\"10f4e5b\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div style=\"max-width:400px;margin:auto;padding:20px;border:1px solid #ddd;border-radius:10px;font-family:Arial;\">\n  <h2>Calculateur Simple<\/h2>\n\n  <div id=\"lignes\">\n    <input type=\"number\" class=\"ligne\" placeholder=\"Valeur\" style=\"width:100%;padding:10px;margin-bottom:10px;\">\n    <input type=\"number\" class=\"ligne\" placeholder=\"Valeur\" style=\"width:100%;padding:10px;margin-bottom:10px;\">\n  <\/div>\n\n  <button onclick=\"ajouterLigne()\" style=\"width:100%;padding:10px;margin-bottom:10px;background:#eee;border:1px solid #ccc;border-radius:5px;cursor:pointer;\">\n    \u2795 Ajouter une ligne\n  <\/button>\n\n  <button onclick=\"calculer()\" style=\"width:100%;padding:12px;background:#000;color:#fff;border:none;border-radius:5px;cursor:pointer;\">\n    Calculer\n  <\/button>\n\n  <p id=\"resultat\" style=\"margin-top:15px;font-weight:bold;\"><\/p>\n<\/div>\n\n<script>\nfunction ajouterLigne() {\n  let container = document.getElementById(\"lignes\");\n  let input = document.createElement(\"input\");\n  input.type = \"number\";\n  input.className = \"ligne\";\n  input.placeholder = \"Valeur\";\n  input.style.width = \"100%\";\n  input.style.padding = \"10px\";\n  input.style.marginBottom = \"10px\";\n  container.appendChild(input);\n}\n\nfunction calculer() {\n  let lignes = document.getElementsByClassName(\"ligne\");\n  let total = 0;\n\n  for (let i = 0; i < lignes.length; i++) {\n    total += Number(lignes[i].value) || 0;\n  }\n\n  document.getElementById(\"resultat\").innerText = \"R\u00e9sultat : \" + total;\n}\n<\/script>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Calculateur Simple \u2795 Ajouter une ligne Calculer<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-24","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/simulios.fr\/index.php?rest_route=\/wp\/v2\/pages\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simulios.fr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/simulios.fr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/simulios.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simulios.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":8,"href":"https:\/\/simulios.fr\/index.php?rest_route=\/wp\/v2\/pages\/24\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/simulios.fr\/index.php?rest_route=\/wp\/v2\/pages\/24\/revisions\/83"}],"wp:attachment":[{"href":"https:\/\/simulios.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}