I have this code
and jquery
Concerning the jQuery part, try to use event delegation.
From the docs:
The .on() method attaches event handlers to the currently selected set of elements in the jQuery object.
$(document).on('click', '.icon-logo', function(event) {
document.write('Event type: ' + event.type);
document.write('
CSS-Class: ');
document.write($(this).attr('class'));
});
// As said in the docs, you can attach multiple events to multiple selectors.
// A typical example of use may be:
// $(document).on('change blur', '.icon-logo .some-other-class', function() {...}
Edit after @Kaiido's comment:
element can't be clicked.One possibility could be to not use an at all but an
tag instead as suggested in this SO answer: make an html svg object also a clickable link.
This kind of tag needs some content to show up on the page.
Your tag:
is not having any inner HTML-Content, so you won't be able to click it.