2023-08-02T15:31:55.png

<!DOCTYPE html>
<html lang="zh">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>网页名称</title>
  <style>


  </style>
</head>
<body>
  
<textarea id="input-1"></textarea>
<textarea id="input-2"></textarea>
<textarea id="output"></textarea>
<button id="process-btn">处理</button>



  <script>

const input1 = document.getElementById('input-1');
const input2 = document.getElementById('input-2');
const output = document.getElementById('output');
const processBtn = document.getElementById('process-btn');

processBtn.addEventListener('click', function() {
  const lines = output.value.split('\n');
  const result = [];

  for (let i = 0; i < lines.length; i++) {
    const line = lines[i].trim();

    if (line && i % 2 === 0) {
      result.push(`${input1.value}${line}${input2.value}`);
    } else {
      result.push(line);
    }
  }

  output.value = result.join('\n');
});

  </script>
</body>
</html>