自动刷新api数据

i need to refresh particular data line in every interval when the value change

$(document).ready(
  function() {
    setInterval(function() {
         var randomnumber = Math.floor();
         $('#output').text(
             gettxt()+ randomnumber);
         }, 1000);
    });

            function gettxt(){
                
                fetch('https://min-api.cryptocompare.com/data/top/exchanges?fsym=BTC&tsym=USD')
                 .then((res)=>res.text())
                 .then((data)=>{
                     document.getElementById('output').innerHTML=data;
                     
                 })
                
            }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<html>          
            <body>
                    
           
            
            <div id="output" style="margin:5px 0;">
                
            </div>
            
            <script type="text/javascript"
            src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
            </body></html>

Here i get all refreshed in every seconds. i need to refresh only a particular line

</div>

Hi Here I done as per your req, Just one line I have done, for other line do by your self, I just makes your string obj into obj and added table style.

js fiddle

html

 <style>
table {
    font-family: arial, sans-serif;
    border-collapse: collapse;
    width: 100%;
}

td, th {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;
}

tr:nth-child(even) {
    background-color: #dddddd;
}
</style>
 <div id="output" style="margin:5px 0;">

                </div>
                <table>
  <tr>
    <th style="margin-left:20px">exchange</th>
    <th>fromSymbol</th>
    <th>toSymbol</th>
    <th> volume24h</th>
    <th>volume24hTo</th>
  </tr>
  <tr>
    <td>Bitfinex</td>
    <td>BTC</td>
     <td>USD</td>
       <td id="volume24h">BTC</td>
     <td id="volume24hTo">USD</td>
  </tr>



</table>

java script

$(document).ready(
      function() {
         setInterval(function() {
             var randomnumber = Math.floor();
             $('#output').text(
                 gettxt()) + randomnumber;
             }, 1000); 
              gettxt()
        });

                function gettxt(){

                    fetch('https://min-api.cryptocompare.com/data/top/exchanges?fsym=BTC&tsym=USD')
                     .then((res)=>res.text())
                     .then((data)=>{
                     var dataTemp = JSON.parse(data);
                         document.getElementById('volume24h').innerHTML=dataTemp.Data[0].volume24h;
                          document.getElementById('volume24hTo').innerHTML=dataTemp.Data[0].volume24hTo;
                         console.log(dataTemp);
                     })

                }