Skip to content

value attribute in <input> tag #939

@ColorFuzzy

Description

@ColorFuzzy

Put <input value=5 id="input"> in body and input a 10 in input field.
$("#input").attr("value") will return 10;
$("#input").attr("value", 20) will replace value=5 to value=20, but the input field will not change.

  1. I can't get the value attribute value.
  2. I can't set the input field value.

pure javascript:
document.getElementById("input").value will get(can set) input field value;
document.getElementById("input").g[s]etAttribute("value", 20) will get/set value attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions