英文:
How to make auto-focus button when page is loaded
问题
当我加载我的页面时,具有类"btn-group"
的<div>
中的三个按钮默认情况下不会聚焦或激活。我如何使它们在页面加载时自动激活?
<div class="btn-group" role="group">
<button type="button" class="btn btn-outline-success btn-lg">Broiler</button>
<button type="button" class="btn btn-outline-success btn-lg">Layer</button>
<button type="button" class="btn btn-outline-success btn-lg">Free Range</button>
</div>
英文:
When I load my page, the three buttons in my <div>
with class "btn-group"
are not focused or activated by default. How can I make them auto-active when the page loads?
<div class="btn-group" role="group">
<button type="button" class="btn btn-outline-success btn-lg">Broiler</button>
<button type="button" class="btn btn-outline-success btn-lg">Layer</button>
<button type="button" class="btn btn-outline-success btn-lg">Free Range</button>
</div>
答案1
得分: 0
英文:
<div class="btn-group" role="group">
<button type="button" class="btn btn-outline-success btn-lg" autofocus >Broiler</button>
<button type="button" class="btn btn-outline-success btn-lg" >Layer</button>
<button type="button" class="btn btn-outline-success btn-lg" >Free Range</button>
<div>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论