<commit_before><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Exercise 4: Find the area of a triangle where lengths are entered into a form</title>
</head>
<body>
<h1>Find the area of a triangle</h1>
<p>Enter the length of the 3 sides of your triangle below.</p>

<form action="myForm">
    <h4>Side 1 <input type="number" id="a" required min=">0" step=".1"></h4><br />
    Side 2 <input type="number" id="b"><br />
    Side 3 <input type="number" id="c"><br />
</form>

<button onclick="myFunction()">Area of my Triangle</button>


<p id="demoB">B</p> <p id="demoC">C</p>

<p id="demoP">P after</p>
<p id="demo"></p>

<script>
    function myFunction() {

        var a = document.getElementById("a").value *1;
        console.log(typeof a);
        var b = document.getElementById("b").value *1;
        console.log(typeof b);
        var c = document.getElementById("c").value *1;
        console.log(typeof c);
        var p = (a + b  + c )/2;
        console.log(typeof p);
        document.getElementById("demoA").innerHTML = a;
        document.getElementById("demoB").innerHTML = b;
        document.getElementById("demoC").innerHTML = c;
        document.getElementById("demoP").innerHTML = p;
        var x = Math.sqrt(p* ((p - a)*(p - b)*(p - c)));
        document.getElementById("demo").innerHTML = x;
        console.log(typeof x);
    }
</script>

</body>
</html><commit_msg>Adding input form to  Exercise 4. function now give the correct answer with all the vars typed and Nums. Looks like error typing: Find the area of a triangle where lengths of the three of its sides.<commit_after><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Exercise 4: Find the area of a triangle where lengths are entered into a form</title>
</head>
<body>
<h1>Find the area of a triangle</h1>
<p>Enter the length of the 3 sides of your triangle below.</p>

<form action="myForm">
    <h4>Side 1 <input type="number" id="a" required min=">0" step=".1"></h4><br />
    Side 2 <input type="number" id="b"><br />
    Side 3 <input type="number" id="c"><br />
</form>

<button onclick="myFunction()">Area of my Triangle</button>

<p id="demo"></p>

<script>
    function myFunction() {

        var a = document.getElementById("a").value *1;
        console.log(typeof a);
        var b = document.getElementById("b").value *1;
        console.log(typeof b);
        var c = document.getElementById("c").value *1;
        console.log(typeof c);
        var p = (a + b + c )/2;
        console.log(typeof p);
        var x = Math.sqrt(p* ((p - a)*(p - b)*(p - c)));
        console.log(typeof x);
        document.getElementById("demo").innerHTML = x;
    }
</script>

</body>
</html>
{'fraction_non_alphanumeric': 0.17483540599853695, 'fraction_numerical': 0.012070226773957572, 'mean_word_length': 3.0578635014836797, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4318503', 'n_tokens_mistral': 907, 'n_tokens_neox': 877, 'n_words': 274}