From 15b715816e616fea8806411115d33bf6bf91371d Mon Sep 17 00:00:00 2001 From: saikrishna823 <108755854+saikrishna823@users.noreply.github.com> Date: Tue, 10 Oct 2023 21:44:29 +0530 Subject: [PATCH] Add files via upload --- Calculator/saikrishna823/calculator.js | 16 +++++++ Calculator/saikrishna823/index.html | 37 +++++++++++++++ Calculator/saikrishna823/styles.css | 63 ++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 Calculator/saikrishna823/calculator.js create mode 100644 Calculator/saikrishna823/index.html create mode 100644 Calculator/saikrishna823/styles.css diff --git a/Calculator/saikrishna823/calculator.js b/Calculator/saikrishna823/calculator.js new file mode 100644 index 000000000..6b8a64f0e --- /dev/null +++ b/Calculator/saikrishna823/calculator.js @@ -0,0 +1,16 @@ +let inputBtn=document.getElementById("inputBtn") +let buttons=document.querySelectorAll(".button"); +const evalButton=document.getElementById("evalButton"); +const clearBtn=document.querySelector(".clearBtn"); +buttons.forEach((button)=>{ + button.onclick=()=>{ + inputBtn.value+=button.textContent; + } + }) +; +evalButton.onclick=()=>{ + inputBtn.value=eval(inputBtn.value); +} +clearBtn.onclick=()=>{ + inputBtn.value=" "; +} \ No newline at end of file diff --git a/Calculator/saikrishna823/index.html b/Calculator/saikrishna823/index.html new file mode 100644 index 000000000..5d8b34253 --- /dev/null +++ b/Calculator/saikrishna823/index.html @@ -0,0 +1,37 @@ + + +
+