From 646c0cfce652d49771040b38d16aa0927eb5dde0 Mon Sep 17 00:00:00 2001 From: Wesley Gomes Date: Mon, 17 Sep 2018 17:26:10 -0300 Subject: [PATCH] Update tagueamento.js --- 004/tagueamento.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/004/tagueamento.js b/004/tagueamento.js index e69de29..be467d7 100644 --- a/004/tagueamento.js +++ b/004/tagueamento.js @@ -0,0 +1,22 @@ +var arrayButtons = []; // array vazio + +$(document).ready(function() { + buttonClick(); + eachButtonInfo(); + console.log(arrayButtons); +}); + +function buttonClick() { // click no botão + $('#botoes button').on('click', function(e) { + var currentName = $(this).text(); + alert(currentName); + console.log(currentName); + }); +} + +function eachButtonInfo() { // informação de cada botão + $('#botoes button').each(function(i, obj) { + var currentName = $(obj).text(); + arrayButtons.push(currentName); + }); +}