Hi guys this is my jQuery part that makes my menu for my pages.
function fetchmenus() {
$.getJSON(\'sys/classes/fetch.php?proccess=1\', function(status)
Yes, you can select only the text contents of the element, like this:
var text = '';
$('a').contents().each(function(){
if(this.nodeType === 3){
text += this.wholeText;
}
});
$("#largemenutop").html(text);
Nice solution Herman, though it can be reduced to something like this:
$('li a').contents().filter(function() {
return this.nodeType == 3;
}).text();
<li><a href="#">Apple<span>hi</span> Juice</a></li>
Will return Apple Juice
Fiddle: http://jsfiddle.net/49sHa/1/