Button state focused from start?


How can I make buttons appear focused (active) from start?
I have spend such a long time trying to make it happen, and Google doesn’t seem to have the answers.

Hope someone can help!

Kind regards Maja

@majaliv - can you elaborate on your request? Are you looking for a single button to appear styled differently on load? All of your buttons to appear focused?

You can definitely do this with a bit of js: https://www.geeksforgeeks.org/javascript-focus/#:~:text=It%20sets%20the%20element%20as,supported%20by%20all%20the%20browsers.

Thanks for answer!
Yes. The styling of the button should be different on load. I will try with the link you sent.

I have created an example. The button “button 1” should appear focused (= black fill) on load.