Skip to content
Advertisement

Tag: center

How to center a button in Javascript

I am trying to center a button in Javascript so that it is horizontally centered in the page. Right now, my button is in a in my html file, so I don’t know how I can use CSS to center it since it’s in Javascript. TLDR: In Javascript, if I hvae declared a button btn, what code should I write

Advertisement