1 回答
TA贡献1812条经验 获得超5个赞
只是一个简单的document.getElementById应该返回您所需的元素,并.value让您访问元素的值,就像普通变量一样。
onload = function() {
var textField = document.getElementById("first");
var value = textField.value; //read
textField.value = "something"; //write
}
<div id="popover-content-right" class="well popover-right" data-
dicomgrid-active-popover="create" style="top: 133px; width: 480px;
display:
block;">
<form id="edit-user" onsubmit="return saveForm(this)">
<div class="form-inline">
<div class="form-group">
<label data-i18n-token="global:first-name">First name</label><br>
<input id="first" data-validate="required" class="form-control">
<span class="help-inline small"></span>
</div>
</div>
</form>
</div>
添加回答
举报