<input id="input" required="required" />
document.getElementById("input").getAttribute("required")结果是:
document.getElementById("input").getAttribute("required")