Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions 004/tagueamento.js
Original file line number Diff line number Diff line change
@@ -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);
});
}