So for this have to separate something? I mean like focusin can be used for input fields? And mousedown only for button elements? I just got in my head really not have to use this same both times as is useless?
Click on the empty white-space in the preview. Then press TAB button. that will ‘focus’ on the input and turn it red. then if you click it will turn green.
mousedown is a half click, it applies to anything mouse clicks on. Normally you want to use click instead, so user have a chance to change his mind, because in order to click event to fire both mousedown and mouseup should be on top of the same element. You can try it yourself: point mouse to any link, press mouse, then move mouse away and un-press - everyone deserves a second chance
focus can be use used on any focusable element, natively on input, button, a etc. as well as any other element you program to be focusable by using tabindex=0.
And what about order event like both? So first is mousedown after the click event? and mouseup? Or this not correct? Like can not use mousedown after use click?