/*@lang css
#target {
height: 100px;
background-color: red;
transition: opacity 1s;
}
*/
const target = document.getElementById("target");
target.addEventListener('click', () => target.style.opacity = '0');
// If you want to remove it from the page after the fadeout
target.addEventListener('transitionend', () => target.remove());