<!DOCTYPE html>
<html>
<body>
<h2>4つの値を入力してください:</h2>
<label for="value1">値1:</label><br>
<input type="text" id="value1" name="value1"><br>
<label for="value2">値2:</label><br>
<input type="text" id="value2" name="value2"><br>
<label for="value3">値3:</label><br>
<input type="text" id="value3" name="value3"><br>
<label for="value4">値4:</label><br>
<input type="text" id="value4" name="value4"><br>
<button onclick="getInputs()">提出</button>
<p id="result"></p>
<script>
function getInputs() {
var inputs = [
document.getElementById("value1").value,
document.getElementById("value2").value,
document.getElementById("value3").value,
document.getElementById("value4").value
];
var formatted_inputs = inputs.map(i => `"${i}"`).join(" ");
document.getElementById("result").innerText = formatted_inputs;
}
</script>
</body>
</html>
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme