javascript - How to apply a class to all button? -


In one of my projects I have used the input [type = "button"] all the buttons But the style works fine in all browsers except Internet Explorer 6. This does not style the button.

Is there a solution for this, like creating a few squares for buttons and applying it to all buttons?

I want to apply that square to all buttons, but not manually. I think it is possible to use jQuery for this, can you please help me on this?

I usually prefer not to use javascript for this, so i class = "Text" Input & gt; Text type for elements, class = "" button > type code for gt; elements of type, and so on. I can match them with input.text and so on.

When you do not want to do it manually, I consider it a better practice if you still want to add it to jQuery , Then you do it like this:

  $ ('Input: button'). AddClass ('button'); // to include & lt; Button & gt; Element: $ ('Button, Input : 'Button'). AddClass ('button'); // text input: $ ('input: text') addClass ('text'); // and so on ...  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -