$(xml).find('event[test]').each(function(){ var name = $(this).attr('name'); $('<option value="'+name+'"></option>').html(name).appendTo ('#select_event'); });
or $(xml).find('event').each(function(){ if ( $(this).attr('test') ) { // do something special } else { var name = $(this).attr('name'); $('<option value="'+name+'"></option>').html(name).appendTo ('#select_event'); } }); On Dec 11, 6:57 am, Crazy-Achmet <[EMAIL PROTECTED]> wrote: > Hey, > > i couldn't get it to work! > > This is my code to get all the event nodes. > > $(xml).find('event').each(function(){ > var name = > $(this).attr('name'); > $('<option > value="'+name+'"></option>').html(name).appendTo > ('#select_event'); > }); > > But i just want to show a special event (for example where the the > attribute name equals to "test"). Can someone help me with a code > example. > > Greetings > > Flo