Click to Autofill
Text Input:
Dropdown Input: First Option Second Option Third Option
Radio Input: First Radio Second Radio Third Radio
Bây giờ, chúng tôi sẽ tự động phát biểu mẫu này với một số văn bản trong văn bản đầu vào của chúng tôi, văn bản của tôi. Chúng tôi sẽ chọn mục thả xuống thứ hai và chúng tôi sẽ chọn nút radio thứ ba.
function autoFill[] {
document.getElementById['input1'].value = "My Text Input";
document.getElementById['input2'].value = "Dropdown2";
var radioElements = document.getElementsByName["input3"];
for [var i=0; i