{"id":59,"date":"2024-08-27T12:18:05","date_gmt":"2024-08-27T09:18:05","guid":{"rendered":"https:\/\/planeta21vek.ru\/elina732\/eng\/?p=59"},"modified":"2025-11-20T20:53:34","modified_gmt":"2025-11-20T17:53:34","slug":"atribut-autofocus","status":"publish","type":"post","link":"https:\/\/planeta21vek.ru\/elina732\/eng\/2024\/08\/27\/atribut-autofocus\/","title":{"rendered":"Global autofocus attribute"},"content":{"rendered":"<p style=\"text-align: justify;\">The autofocus attribute sets the default automatic input focus for HTML form fields when the page loads. The element that has the autofocus attribute set will have focus when the page loads (the cursor will blink in it if you start typing text from the keyboard &#8211; it will fall into the field with input focus). The attribute is an attribute without a value. It should be applied to the input, button or textarea tags and only one element per page, otherwise there will be a conflict.<\/p>\n<p><!--more--><\/p>\n<p style=\"text-align: justify;\">The autofocus attribute sets the button to receive focus after the page loads. You can click such a button immediately without transferring focus to it, for example, using the keyboard. By default, this value is disabled. Automatically sets focus to the form field. You can immediately type text in such a field without explicitly clicking on it with the mouse cursor. Compatible with all browsers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-60\" src=\"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-content\/uploads\/2024\/08\/autofocus270824.png\" alt=\"\" width=\"359\" height=\"241\" srcset=\"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-content\/uploads\/2024\/08\/autofocus270824.png 359w, https:\/\/planeta21vek.ru\/elina732\/eng\/wp-content\/uploads\/2024\/08\/autofocus270824-300x201.png 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><br \/>\n\n<span style=\"color: #993300;\"><strong>Example 1<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n &lt;fieldset&gt;\r\n&lt;p&gt;By clicking Next, you agree to all terms and conditions\r\nLicense agreement, either express or stated \r\nin an implicit form.&lt;\/p&gt;\r\n&lt;p&gt;&lt;button autofocus value=&quot;next&quot;&gt;Next&lt;\/button&gt;&lt;\/p&gt;\r\n&lt;\/fieldset&gt;\r\n<\/pre>\n<p><span style=\"color: #993300;\"><strong>Example 2<\/strong><\/span><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n &lt;form action=&quot;handler.php&quot;&gt;\r\n&lt;p&gt;Search the site&lt;\/p&gt;\r\n&lt;p&gt;&lt;input type=&quot;search&quot; name=&quot;s&quot; autofocus&gt;\r\n&lt;input type=&quot;submit&quot; value=&quot;Search&quot;&gt;&lt;\/p&gt;\r\n&lt;\/form&gt;\r\n<\/pre>\n\n","protected":false},"excerpt":{"rendered":"<p>The autofocus attribute sets the default automatic input focus for HTML form fields when the page loads. The element that has the autofocus attribute set will have focus when the page loads (the cursor will blink in it if you start typing text from the keyboard &#8211; it will fall into the field with input focus). The attribute is an attribute without a value. It should be applied to the input, button or textarea tags and only one element per page, otherwise there will be a conflict.<\/p>\n","protected":false},"author":1,"featured_media":60,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[18,16,13],"class_list":{"0":"post-59","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-htmlverstka","8":"category-programmirovanie","9":"tag-autofocus","10":"tag-css","11":"tag-html"},"_links":{"self":[{"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":4,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/posts\/59\/revisions\/309"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/media\/60"}],"wp:attachment":[{"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planeta21vek.ru\/elina732\/eng\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}