JSFiddle - React, Tailwind, and code Playground

by franklinjavier

HTML

<header>
<a href="/usuarioTeste"><img class="pic-profile" src="semfoto.png" width="180" height="180" alt="logo" /></a>
<button class="button-change-image-profile" style="display:none"><span>Editar</span></button>
</header>

JavaScript

$(document).ready(function() {

    $('.pic-profile').hover(function() {
        // se for usar o this e target mais de uma vez
        // eh uma boa pratica referencia-los (cachear = atribuir a uma variavel)
        var $this = $(this),
            $target = $this.closest('header').find('.button-change-image-profile');
        
         $target.show();
        
        // se nao use assim
        // $(this).closest('header').find('.button-change-image-profile').show();


    }, function() {

        var $this = $(this),
            $target = $this.closest('header').find('.button-change-image-profile');
        
         $target.hide();
        
         // $(this).closest('header').find('.button-change-image-profile').hide()

    });

}); //fecka jquery