1$(document).ready(function(){
2 $("button").click(function(){
3 $("p").fadeOut(2500);
4 });
5});
1$(document).ready(function(){
2 $("button").click(function(){
3 $("p").fadeOut();
4 });
5});
1const target = document.getElementById("target");
2
3target.addEventListener('click', () => target.style.opacity = '0');
4// If you want to remove it from the page after the fadeout
5target.addEventListener('transitionend', () => target.remove());