I'm using Bootstrap 3 to create some HTML responsive forms, and there's one thing I'm trying to do, about layout.
I want to change dynamically the height of buttons and text fields by following these rules:
- On desktop devices, use small buttons / text fields
- On mobile devices, use large buttons / text fields
I know that I can do it by using these button and text field classes. But, I want to use these classes only if user is accessing the page from a mobile device, not always.
I know, too, that you can show/hide HTML elements by using these classes from Bootstrap Responsive Utilities, but I need to give an id to all buttons / text fields, so I don't know if I can duplicate these elements and wrap each of then inside a div that will be shown on a specific environment, since two elements with the same id is wrong by HTML specifications.
I tried an approach based on that solution, and I simply add/remove these classes based on each state/environment. It's working, but is there an easier approach to this?