HTML / JS Slot Machine Simulator
Some improvements: 

Use of refresh() as a function used to generate the number values, which generate the values AND writes into the DOM element.

Use of a function to manage all user messages, write_message()

Remove of all the old fashion HTML tags, and change it for CSS.

A function for managing spending the "credits" to make it easier to manage them.

&lt;!DOCTYPE html&gt;
&lt;html&gt;

&lt;head&gt;

    &lt;meta charset="utf-8"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt;
    &lt;title&gt;www.loseloselose.com&lt;/title&gt;

    &lt;script&gt;
        var count = 0;
        var sound = new Audio("winner.wav");

        function write_message( $message ) {
            document.getElementById('messages').innerHTML = $message;
        }

        function refresh()
        {
            if ( count &gt; 0 ) {
                refreshCounts(-1);
                var one = Math.floor((Math.random()*9)+1);
                var two = Math.floor((Math.random()*9)+1);
                var three = Math.floor((Math.random()*9)+1);

                document.getElementById('first').innerHTML = one;
                document.getElementById('second').innerHTML = two;
                document.getElementById('third').innerHTML = three;

                if ( one == two &amp;&amp; two == three &amp;&amp; three == one  ) {
                    write_message( 'winner!' );
                } else {
                    write_message( 'wasted try...' );
                }
            } else {
                write_message( 'I need credits to give you fun!' );
            }
        }

        function refreshCounts( value ) {
            count = count + value;
            document.getElementById("p2").innerHTML = count;
        }
    &lt;/script&gt;

    &lt;style&gt;
        body {
            text-align: center;
            background-color: black;
        }

        p, a {
            color: yellow;
            font-weight: 12px;
        }

        .title {
            font-size: 50px;
            text-align: center;
        }

        #machine {
            text-align: center;
        }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;p class="title"&gt;
    Lucky Number Slots
&lt;/p&gt;


&lt;div id="machine"&gt;
    &lt;svg width="550" height="250" viewBox="0 0 1600 500"&gt;

    &lt;rect x="0" y="10" width="500" height="500" fill="black" stroke="white" stroke-width="10"&gt;
    &lt;/rect&gt;

    &lt;rect x="550" y="10" width="500" height="500" fill="black" stroke="white" stroke-width="10"&gt;
    &lt;/rect&gt;

    &lt;rect x="1100" y="10" width="500" height="500" fill="black" stroke="white" stroke-width="10"&gt;
    &lt;/rect&gt;

    &lt;text x="100" y="415" font-family="courier" font-size="500" fill="white" id="first"&gt;
    0
    &lt;/text&gt;

    &lt;text x="650" y="415" font-family="courier" font-size="500" fill="white" id ="second"&gt;
    0
    &lt;/text&gt;

    &lt;text x="1200" y="415" font-family="courier" font-size="500" fill="white" id="third"&gt;
    0
    &lt;/text&gt;
    &lt;/svg&gt;
&lt;/div&gt;


&lt;p&gt;
    &lt;input type="button" value="Click Here To Spin" onClick="refresh()"&gt;
&lt;/p&gt;

&lt;p&gt;
    &lt;a href="javascript:refreshCounts(+1)"&gt;Add Credit&lt;/a&gt;
&lt;/p&gt;

&lt;p id="p2"&gt;0&lt;/p&gt;

&lt;p id="messages"&gt;&lt;/p&gt;