Hide and element and show another element
Hi,
In my jQuery code I want to achieve that by clicking a link one element replaces another element:
Now the problem is that if I click the link ("
Click me to swap"), the visible element fades out but the hidden element which should show, doesn't show.
This is the jQuery function:
- function upload() {
- var i = 0;
- $('#upload').on('click', function() {
- i++;
- $('.upload-wrapper__item__icon-container--upload#' + i).remove();
- $('this').closest('.upload-wrapper__item__icon-container--file').show();
- });
- }
What is my mistake?
Thanks