$(function() { $('.menu').on('click', 'a', function(evt){ evt.preventDefault(); $('p').html($(this).text()); }); });