Write a JavaScript program to find the area of a triangle where lengths of the three of its sides are 5, 6, 7.

 <!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="answer"></div>
    base<input type="number" name="" id="base">
    height<input type="number" name="" id="height">
    <input type="button" value="submit" id="submit">


    <script>
        let submit = document.getElementById('submit');
        submit.addEventListener("click"function () {
            let answer = document.getElementById('answer');
            let base = document.querySelector('#base').value;
            let height = document.querySelector('#height').value;
            // console.log(typeof(base));
            // console.log(base);
            let area = base * height;
            // console.log(area);
            answer.innerHTMLarea;
        });
    </script>
</body>

</html>

Comments

Popular posts from this blog

Write a JavaScript program to get the current date.

Store and display the values of text boxes of a form

Write a JavaScript program to count and display the items of a dropdown list, in an alert window