I'm trying to give the same function to 2 elements.
Here's what I've got which isn't working:
$(document).ready(function() {
$('#menu a, p.bodytext a').click(function() {
$('#content_bg').load($(this).attr('href')+' #content');
return false;
});
});
Now it works if I go like this:
$(document).ready(function() {
$('#menu a').click(function() {
$('#content_bg').load($(this).attr('href')+' #content');
return false;
});
});
or like this:
$(document).ready(function() {
$('p.bodytext a').click(function() {
$('#content_bg').load($(this).attr('href')+' #content');
return false;
});
});
But does not work with them together.
Suggestions?