Make menu in menu list using JavaScript


How to make menu in menu list in front end ?

Menu in menu list:

<link href=”http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css”rel=”stylesheet”/&gt;

 

in HTML , I made this script like:

<ul class=”nav” id=”main-menu”>

</ul>

 

in JavaScript, I made this script like :

var list = document.createElement(“li”);

list.innerHTML=

“<a href=\”#\”>List<span class=\”fa arrow\”></span></a>”

+”<ul class=\”nav nav-second-level\”>”

+”<li><a href=\”groupMerchant\”>Group Merchant</a></li>”

+”</ul>”;

menuId.appendChild(list);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s