The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

JavaScript question

View previous topic View next topic Go down

JavaScript question

Post by Nape4 on June 17th 2015, 1:00 am

Is it possible to program a code that allows a attack button to automatically do hp like these examples
Code:


[code]

 document.getElementById("attack").click(); = dragon.hp = dragon.hp - 10;

[size=13][code]document.getElementById("attack").onclick = function(){
  dragon.hp -[/code][/size]
[size=13][code]document.getElementById("attack").addEventListener('click', function(){
  dragon.hp -= 10;
});[/code]
[code]dragon.hp -= 10;[/code]

[code]dragon.hp = dragon.hp - 10;[/code][
<a ..... onClick="deductHpPoints()">...</a>[/code][code] Function deductHpPoints()
  {
  //deduct logic
  }[/code]
[color=#000000]
Like this code shown to work with a rpg character sheet

Nape4
Forumember

Male Posts : 110
Reputation : 0
Language : English
Location : SC USA

Http://lucario-domain.ogamebattle.com/forum

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum