JSFiddle - React, Tailwind, and code Playground

by MythOfEchelon

HTML

<!DOCTYPE html> <!-- This is just my HTML5-valid template. Make sure you set this up correctly for your personal needs -->

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        
        <style>
            * {
                margin: 0;
                padding: 0;
            }
        
            html {
                font: 16px "Segoe UI", "Segoe WPC", Helvetica, Arial, "Arial Unicode MS", Sans-Serif;
            }
            
            div {
                float: left;
            }
        </style>
    </head>
    
    <body>
        <div id="page_Wrapper">
            <div>
                <input type="text" id="a" />
            </div>
            <div>
                <input type="text" id="b" />
            </div>
            <div>
                <input type="text" id="c" />
            </div>
            <div>
                <input type="submit" value="quadratic" onClick="quadratic()" />
            </div>
        </div>
        
        <!-- Include the script after all DOM elements have been created, to avoid any potential DOM-related errors -->
        <script>
            function quadratic(){
                var a = document.getElementById("a").value;
                var b = document.getElementById("b").value;
                var c = document.getElementById("c").value;
                
                if (!a || !b || !c) {
                    /* Using "!" before a variable covers all blank data types - "", null, undefined etc */
                    alert("Please enter a valid number(s).");    
                } else if (a == 0) {
                    alert("There is no minimum value for the linear function.");
                } else {
                    console.log("'a' is currently a " + typeof a + ".");
                    a = parseFloat(a);
                    console.log("'a' is now a " + typeof a + ".");
                    
                    console.log("'b'...