答案 0 :(得分:1)
here is how you can create your own input field
var container = document.getElementById("container")
function myFunction() {
var input = document.createElement("input")
input.type="text";
input.placeholder="Hello i am a new input"
container.appendChild(input)
}
<!DOCTYPE html>
<html>
<body>
<p>Click the button to trigger a function that will create an input field </p>
<button onclick="myFunction()">Click me</button>
<div id="container"></div>
</body>
</html>