leo-y
1/24/2018 - 8:46 PM

jsexample

java script

<!DOCTYPE html>
<!-- saved from url=(0048)http://www.jeffeppinger.com/JavaScript-Examples/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <title>JavaScript ToDoList Example</title>
        <link rel="stylesheet" href="./JavaScript ToDoList Example_files/better-example.css">
        <script>
            function onLoad() {
                var ans = prompt("Is the lecture over yet?");
                var face = '\u262E';  // Peace
                if (ans == "No" || ans == "no") {
                    face = "\u2639";  // Frowning Face
                } else if (ans == "Yes" || ans == "yes") {
                    face = "\u263A";  // Smiling Face
                }
                document.getElementById('face-place')
                    .appendChild(document.createTextNode(face));
            }

            function addNames() {
                var first = document.getElementById("first-name").value;
                var last  = document.getElementById("last-name").value;
                alert(first + last);
                alert(parseInt(first) + parseInt(last));
            }
        </script>
        <style id="style-1-cropbar-clipper">/* Copyright 2014 Evernote Corporation. All rights reserved. */
.en-markup-crop-options {
    top: 18px !important;
    left: 50% !important;
    margin-left: -100px !important;
    width: 200px !important;
    border: 2px rgba(255,255,255,.38) solid !important;
    border-radius: 4px !important;
}

.en-markup-crop-options div div:first-of-type {
    margin-left: 0px !important;
}
</style></head><body onload="onLoad()">&lt; <script src="./JavaScript ToDoList Example_files/isprime.js"></script> 
    

    
        <div class="title">
            ☆ JavaScript Demos <span style="" id="face-place">☹</span>
        </div>
        <div>
            <ul>
                <li><a href="http://www.jeffeppinger.com/JavaScript-Examples/primes.html">primes.html</a></li>
                <li><a href="http://www.jeffeppinger.com/JavaScript-Examples/movement.html">movement.html</a></li>
                <li><a href="http://www.jeffeppinger.com/JavaScript-Examples/todolist.html">todolist.html</a></li>
            </ul>
        </div>
        <div>
            <table>
                <tbody><tr>
                    <td>
                        <label>First Name:</label>
                    </td>
                    <td>
                        <input id="first-name" type="text" name="first" autofocus="">
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>Last Name:</label>
                    </td>
                    <td>
                        <input id="last-name" type="text">
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button onclick="addNames()">Add</button>
                    </td>
                </tr>
            </tbody></table>
        </div>
        <div>
            <label>Check Prime:</label>
            <input id="number" type="text" onfocus="isPrimeFocus()">
            <button id="is-prime-button" onclick="isPrimeClick()">Is Prime?</button>
        </div>
    

</body></html>