Skip to content
Advertisements

Immediate Value Acquisition(not .oninput)

HTML

    <p><input type="text" id="data1" name="data1" /></p>
    <p><input type="text" id="data2" name="data2" /></p>
    <p id="result"></p>

JAVASCRIPT

        var result;
        result = document.getElementById("result");
        times = setInterval(process, 1000);
        function process(){
            var data1, data2, resultValue;
            data1 = Number(document.getElementById("data1").value);
            data2 = Number(document.getElementById("data2").value);
            resultValue = data1 * data2;
            result.innerHTML = resultValue;
        }

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: