Relative Content

Tag Archive for javascripthtmlcalculator

How can display the result of my HTML/JS code?

I wanted to create Js calculator,so I got a problem with displaying the results of my code on textarea. <!DOCTYPE html> <html> <head> <meta charset = “UTF-8”> </head> <body> <script> function handleClick(event) { const action = event.target.dataset.action; const area = document.getElementById(“area”); area.value += String.fromCharCode(action); } let buttons = document.getElementsByClassName(“but”); […buttons].forEach(item => item.addEventListener(‘click’,handleClick)) </script> <textarea row […]

Equasion solver built in calculator

I want to make a calculator, that can calculate normal, but also can calculate eqasions with x, such as 2*x=8 and then gives ,4 or x=4 as an answer. The calculation works, but the part doesnt.