diff --git a/jquery.mobilemenu.js b/jquery.mobilemenu.js
index e51925a..d9d52a8 100644
--- a/jquery.mobilemenu.js
+++ b/jquery.mobilemenu.js
@@ -129,14 +129,19 @@
//function to create options in the select menu
function createOption($item, $container, text){
+ // check for valid href attribute
+ var href = var href = $item.find('a:first').attr('href');
+ if (!href) {
+ href = '#';
+ }
+
+ //if no text param is passed, use list item's text, otherwise use settings.groupPageText
+ if(!text){
+ $('').appendTo($container);
+ } else {
+ $('').appendTo($container);
+ }
- //if no text param is passed, use list item's text, otherwise use settings.groupPageText
- if(!text){
- $('').appendTo($container);
- } else {
- $('').appendTo($container);
- }
-
}//createOption()
@@ -148,7 +153,9 @@
var $optgroup = $('');
//append top option to it (current list item's text)
- createOption($group,$optgroup, settings.groupPageText);
+ if (settings.groupPageText != false) {
+ createOption($group, $optgroup, settings.groupPageText);
+ }
//loop through each sub-nav list
$group.children('ul, ol').each(function(){