Toggle button, button class

Asked

Viewed 126 times

1

Well I’m trying to make a toggle button, but I’m in trouble the button I want needs a class to style in css.

button class="button button1">Shadow Button</button

, but the toggle button code I picked uses a type on the button

button onclick="myFunction()">Try it</button

how do I call this onClick on this button with class:

button class="button button1">Shadow Button</button
  • I don’t understand, why don’t you add the onclick beyond the classes?

  • button class="button button1" onclick="myFunction()">Shadow Button</button

  • would look like this??

1 answer

3


Normal Felipe:

<button type="QUALQUER TIPO (button, submit etc)" onclick="QUALQUER FUNCAO PODE SER CHAMADA AQUI (alert, myfunction etc)" class="QUALQUER CLASSE (button btn btntoogle etc")> meu botao</button>

In HTML5 you can by on-click functions and add classes in almost all elements

Browser other questions tagged

You are not signed in. Login or sign up in order to post.