Presumably you’re not worried that “data-author” won’t validate as a known attribute. This isn’t tested but you can try it, otherwise it may be necessary to use getAttribute.
var allItems = document.getElementsByTagName( 'LI' );
for( var i = 0, anItem; ( anItem = allItems[ i ] ); i++ )
if( anItem[ 'data-author' ] )
anItem.parentNode.removeChild( anItem );
Thanks. With the getAttribute I need to be able to specify what the value of data-author is. So if data-author = “author2” I do not want to remove it. If it’s “author1”, I do.