如何在页面加载时创建自动对焦按钮。

huangapple go评论54阅读模式
英文:

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 &lt;div&gt; with class &quot;btn-group&quot; are not focused or activated by default. How can I make them auto-active when the page loads?

&lt;div class=&quot;btn-group&quot; role=&quot;group&quot;&gt;
   &lt;button type=&quot;button&quot; class=&quot;btn btn-outline-success btn-lg&quot;&gt;Broiler&lt;/button&gt;
   &lt;button type=&quot;button&quot; class=&quot;btn btn-outline-success btn-lg&quot;&gt;Layer&lt;/button&gt;
   &lt;button type=&quot;button&quot; class=&quot;btn btn-outline-success btn-lg&quot;&gt;Free Range&lt;/button&gt;
&lt;/div&gt;

答案1

得分: 0



英文:
&lt;div class=&quot;btn-group&quot; role=&quot;group&quot;&gt;
&lt;button type=&quot;button&quot; class=&quot;btn btn-outline-success btn-lg&quot; autofocus &gt;Broiler&lt;/button&gt;
&lt;button type=&quot;button&quot; class=&quot;btn btn-outline-success btn-lg&quot; &gt;Layer&lt;/button&gt;
&lt;button type=&quot;button&quot; class=&quot;btn btn-outline-success btn-lg&quot; &gt;Free Range&lt;/button&gt;
&lt;div&gt;

huangapple
  • 本文由 发表于 2023年6月16日 12:50:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76487034.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定