Button with two value only with html is possible? [closed]

1

You want to put two actions in the value field of a button, using only html. Is it possible?

My original button:

<button type='roll' name='roll_arma1' value='&{template:default} {{name=Ataque @{nomearma1} @{arma1}}} {{Sucessos=[[{5d4}>3+@{arma1}]]}}'>

I wanted to insert into the value the action # macro1, which performs a function within the site I use, roll20.net

Or even turn these two buttons down into a single one:

<button type='roll' name='roll_arma1' value='&{template:default} {{name=Ataque @{nomearma1} @{arma1}}} {{Sucessos=[[{5d4}>3+@{arma1}]]}}'></button>

<button type='roll' name='roll_arma1' value='!ammo @{selected|character_id} municao1 -1'></button>
    
asked by anonymous 21.07.2017 / 16:29

1 answer

1

You can create your own properties for your html tags using the word data- :

<button type='roll' id='roll_arma1' data-valor-um='meu valor 1' data-valor-dois='meu segundo valor'></button>

To access them, use:

    function pegaValores(){
      var valor1= $("#roll_arma1").data('valor-um');
      var valor2= $("#roll_arma1").data('valor-dois');
      console.log(exigeIdade);
    });

Then call the function in the onclick event of your button. Adapt according to your needs.

    
21.07.2017 / 17:01