怎么让模态框打开就能获得焦点?
</form>
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title" id="exampleModalLabel" style="text-align:center"><img src="~/Images/logo.png" alt="Alternate Text" /><br /> 访客登记</h3>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="recipient-name" class="control-label">姓名:</label>
<input type="text" class="form-control" id="recipient-name" autofocus>
</div>
<div class="form-group">
<label for="recipient-name" class="control-label">身份证号:</label>
<input type="text" class="form-control" id="">
</div>
<div class="form-group">
<label for="recipient-name" class="control-label">工作证号:</label>
<input type="text" class="form-control" id="">
</div>
<div class="form-group">
<label for="recipient-name" class="control-label">厂商:</label>
<input type="text" class="form-control" id="recipient-name">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary">发送消息</button>
</div>
</div>
</div>
</div>