使用JavaScript重新加载垂直文本框/选择选项

时间:2019-04-22 17:52:53

标签: javascript

我想使用javaScript刷新/重新加载特定的文本框/选择选项。就像页面首次加载时一样。

有一个location.reload()选项,但它会重新加载整个页面,而不是一个选项。

我想执行一些操作。有点像

<input type="text" id="1" />
<select id="2">
  <option></option>
</select>

JS

document.getElementById("1").reload();
document.getElementById("2").reload();

我该怎么做?

我只想重新加载文本框或选择选项。

2 个答案:

答案 0 :(得分:1)

只需将所有内容放入表单中并添加一个重置输入类型按钮即可。

<form action="/">
<input type="text" id="1" />
<select id="2">
<option></option>
</select>
<input type="reset" value="Reset">
</form>

答案 1 :(得分:0)

您可以将其设置为空白空间。

global main
extern printf

section .data
    message db "%03X", 0x10, 0x0

section .text
main:
    mov eax, 5
    call factorial
    push eax
    push message
    call printf
    add esp, 0x8
    mov eax, 1
    mov ebx, 0
    int 0x80

factorial:
    push ebp
    push edx
    mov ebp, esp
    mov edx, eax
    cmp edx, 0
    jne not_equal_zero
    mov eax, 1
    jmp exit
not_equal_zero:
    mov eax, edx
    sub eax, 1
    call factorial
    imul eax, edx
exit:
    mov esp, ebp
    pop edx
    pop ebp
    ret

document.getElementById("1").value =""

使用手机检查代码应答。