devwiki:html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
devwiki:html [2021/08/28 07:37] – [css file not loading] yingdevwiki:html [2021/12/20 07:17] – [Style related operation] ying
Line 191: Line 191:
     myButtonClasses.add("red");     myButtonClasses.add("red");
   }   }
 +}
 +</code>
 +
 +===== html select dropdown and remove focus =====
 +  * problem: when select dropdown, the select focus still stuck on the dropdown list, (when you press arrow key)
 +  * solution: to remove focus after choose, add onchange event and remove its focus <code javascript>
 +const choice_input = document.querySelector(".my_choice")
 +choice_input.onchange = function(event){
 +choice_input.blur() // remove focus from this input
 } }
 </code> </code>
  • devwiki/html.txt
  • Last modified: 2023/02/07 18:21
  • by ying