diff --git a/008/tagueamento.js b/008/tagueamento.js index e69de29..4ad1ca3 100644 --- a/008/tagueamento.js +++ b/008/tagueamento.js @@ -0,0 +1,17 @@ +$(document).ready(function() { + buttonClick(); +}); + +function buttonClick() { // click no botão + $('#botao button').on('click', function(e) { + $('#mensagem').on("DOMSubtreeModified", function(e) { + var valueMessage = $('#mensagem div').text(); + if($(this).find('div').length > 0) { // existe mensagem + alert(valueMessage); + console.log(valueMessage); + e.stopPropagation(); + e.stopImmediatePropagation(); + } + }); + }); +}