Title: Custom Menus and Javascript
Last modified: August 21, 2016

---

# Custom Menus and Javascript

 *  Resolved [awstyle](https://wordpress.org/support/users/awstyle/)
 * (@awstyle)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-menus-and-javascript/)
 * I have tried creating custom menu items which have no pages attached but have
   child menus items. I have inserted javascript: void(0); as the URL but when I
   save the menu the url becomes blank.
 * I am very new to WP.
 * Kind regards
 * Tony

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Remon](https://wordpress.org/support/users/remonlumapas/)
 * (@remonlumapas)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-menus-and-javascript/#post-3647180)
 * Try doing this with jQuery. Leave your menu with “#” in the url, and use the 
   class to change the url using jQuery like this:
 * `$(".your-menu-class a").attr('href', 'javascript:void(0)');`
 *  [Chris](https://wordpress.org/support/users/zenation/)
 * (@zenation)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-menus-and-javascript/#post-3647204)
 * Or you could insert a hash tag `#` instead of `void(0);`
 * If you can’t live with jumping to the top of the page when clicking the link 
   you could also block the link “execution” via JS (here jQuery):
    `jQuery('.your-
   menu-class a').click(function(){return false;});`
 *  Thread Starter [awstyle](https://wordpress.org/support/users/awstyle/)
 * (@awstyle)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/custom-menus-and-javascript/#post-3647229)
 * Thanks guys.
    Kind regards Tony

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Custom Menus and Javascript’ is closed to new replies.

## Tags

 * [custom menus](https://wordpress.org/support/topic-tag/custom-menus/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 3 replies
 * 3 participants
 * Last reply from: [awstyle](https://wordpress.org/support/users/awstyle/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/custom-menus-and-javascript/#post-3647229)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
