Basically, I am hardcoding the circles with their labels attached to them. But I want to be able to do this using javascript and a for loop. How would I go about doing this? To give more content, I want basically make seats that have their id number (text) on top of them. Also, is there a way I could automatically center the text to the center of each circle, without having to manually code that part in too? Thanks for your time.
var overlapThreshold = "50%";
var name_count = 0;
var x_axis_seats = 22;
function change_name(event) {
 var name = prompt("Enter a New Name (Max 20 characters):");
 while(name.length > 20) {
    name = prompt("Enter a New Name (Previous Over 20 Characters)");
  }
  if (name != null && name != "") {
event.target.textContent = name;
 }
}<!DOCTYPE html>
<html>
<head>
 <title></title>
</head>
<body>
 <button id="test_button" onclick="create_seats()">Test</button> 
  
  <svg height="1500" width="1500">
 <defs>
  <lineargradient id="gradGreen" x1="0%" x2="100%" y1="0%" y2="0%">
   <stop offset="0%" style="stop-color:rgb(152, 251, 152);stop-opacity:1"></stop>
   <stop offset="100%" style="stop-color:rgb(0, 128, 0);stop-opacity:1"></stop>
  </lineargradient>
  <lineargradient id="gradYellow" x1="0%" x2="100%" y1="0%" y2="0%">
   <stop offset="0%" style="stop-color:rgb(255, 140, 0);stop-opacity:1"></stop>
   <stop offset="100%" style="stop-color:rgb(218, 165, 32);stop-opacity:1"></stop>
  </lineargradient>
  <lineargradient id="gradRed" x1="0%" x2="100%" y1="0%" y2="0%">
   <stop offset="0%" style="stop-color:rgb(255, 0, 0);stop-opacity:1"></stop>
   <stop offset="100%" style="stop-color:rgb(178, 34, 34);stop-opacity:1"></stop>
  </lineargradient>
 </defs>
 <g class="circle_seat" id="circle_seats">
  
        <circle cx="21" cy="580" fill="url(#gradGreen)" id="seat1" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana"x="11" y="590">1</text>
      
        <circle cx="70" cy="580" fill="url(#gradGreen)" id="seat2" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=60 y="590">2</text>
    
        <circle cx="119" cy="580" fill="url(#gradGreen)" id="seat3" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=109 y="590">3</text>
    
        <circle cx="168" cy="580" fill="url(#gradGreen)" id="seat4" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=158 y="590">4</text>
    
        <circle cx="217" cy="580" fill="url(#gradGreen)" id="seat5" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=207 y="590">5</text>
    
        <circle cx="266" cy="580" fill="url(#gradGreen)" id="seat6" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=256 y="590">6</text> 
    
        <circle cx="315" cy="580" fill="url(#gradGreen)" id="seat7" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=305 y="590">7</text>   
    
        <circle cx="364" cy="580" fill="url(#gradGreen)" id="seat8" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=354 y="590">8</text> 
        
        <circle cx="413" cy="580" fill="url(#gradGreen)" id="seat9" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="30" font-family="Verdana" x=403 y="590">9</text> 
            
        <circle cx="462" cy="580" fill="url(#gradGreen)" id="seat10" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x=444 y="590">10</text> 
    
        <circle cx="511" cy="580" fill="url(#gradGreen)" id="seat11" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x=493 y="590">11</text>
        
        <circle cx="609" cy="580" fill="url(#gradGreen)" id="seat12" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="591" y="590">12</text>   
         
        <circle cx="658" cy="580" fill="url(#gradGreen)" id="seat13" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="640" y="590">13</text> 
             
        <circle cx="707" cy="580" fill="url(#gradGreen)" id="seat14" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="689" y="590">14</text> 
        
        <circle cx="756" cy="580" fill="url(#gradGreen)" id="seat15" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="738" y="590">15</text> 
            
        <circle cx="805" cy="580" fill="url(#gradGreen)" id="seat16" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="787" y="590">16</text> 
    
        <circle cx="854" cy="580" fill="url(#gradGreen)" id="seat17" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="836" y="590">17</text>     
        
        <circle cx="903" cy="580" fill="url(#gradGreen)" id="seat18" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="885" y="590">18</text> 
            
        <circle cx="952" cy="580" fill="url(#gradGreen)" id="seat19" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="934" y="590">19</text> 
                
        <circle cx="1001" cy="580" fill="url(#gradGreen)" id="seat20" r="20" stroke="black" stroke-width="1" />
        <text fill="#black" font-size="28" font-family="Verdana" x="983" y="590">20</text> 
    
    
    
    
    
    
  </g>
 
  
  
  
  <g class="seat_name" id="seat_name1">
  <text fill="#black" font-family="Verdana" font-size="15" id="seat_name1" ondblclick="change_name(event)" x="250" y="210">
   BLANK
  </text>
 </g>
  
  </svg>
</body>
</html>Here is my code:
 
    