Catch value of a dice and play on var

0

I'm developing a web server in CLP, in it will be able to get the data from an air hose, to know if the pressure is ok. I developed the code in js and I set a value to see if it worked, but now I want to get the value of this pressure and if it reaches a certain number, go to the page in question

follow the code

$('#bot).on('
click ',function(){
})

var i = 0;

setInterval(function() {
            $('counter').text(i);
            i++;
            if (i == 6) {
                $('#pag-1).show();
                    $('pag-2).hide();
                    }
                }, 1000)

no var i , do you know which function to use to pull data from a particular location?

    
asked by anonymous 13.06.2017 / 19:49

1 answer

0

If your intention is to get value from a input , just do the following:

jQuery(function($){
   var i = $('#numero').val(); 

   console.log(i);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>Número<inputtype="text" id="numero" value="5">
    
13.06.2017 / 20:04