I need to get the click event of a button from class btn-remove
, however, it is giving the following error:
Uncaught ReferenceError: $ is not defined
<html> <head> <meta charset="utf-8"> </head>
<body>
<h1>Teste de button</h1>
<button class="btn-remove" data-id='2'>Deletar</button>
<script>
$('.btn-remove').click(function(){
let id = $(this).attr('data-id');
});
</script>
</body>
</html>