Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7588977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:03:38+00:00 2026-05-30T20:03:38+00:00

I’m working with WordPress and 2 different plugins (Icons per post & pages and

  • 0

I’m working with WordPress and 2 different plugins (Icons per post & pages and Multi-Level navigation). With the first plugin I selected a Icon per a page and with the second I built a dropdown menu.

The thing is that I want to show only the page Icon but the plugin remains writing the page title. I want to delete it with jQuery.

This is the generated HTML for the menu:

<ul class="children" style="display: none; visibility: hidden; ">
  <li class="page_item page-item-514">
    <a href="http://www.pausoberriak.net/lan-emailea/onurak/?lang=eu">
      <img src="http://www.pausoberriak.net/wp-content/uploads/icons/beneficios.png" class="page_icon" alt="Onurak">Onurak</a>
  </li>
  <li class="page_item page-item-179">
    <a href="http://www.pausoberriak.net/lan-emailea/lan-emailea-formulak/?lang=eu">
      <img src="http://www.pausoberriak.net/wp-content/uploads/icons/formulas.png" class="page_icon" alt="Formulak">Formulak</a>
    <ul class="children" style="display: none; visibility: hidden; ">
          <li class="page_item page-item-183">
            <a href="http://www.pausoberriak.net/lan-emailea/lan-emailea-formulak/praktikak-enpresetan/?lang=eu">Praktikak enpresetan</a>
          </li>
      <li class="page_item page-item-186">
            <a href="http://www.pausoberriak.net/lan-emailea/lan-emailea-formulak/lanerako-zerbitzuak/?lang=eu">Zerbitzu Okupazionala</a>
          </li>
      <li class="page_item page-item-195">
            <a href="http://www.pausoberriak.net/lan-emailea/lan-emailea-formulak/kontratazioa/?lang=eu">Kontratazioa</a>
          </li>
        </ul>
  </li>
</ul>

I used this code to delete the text, in that case it should delete “Onurak”, “Formulak”, “Praktikak enpresetan”, “Zerbitzu okupazionala” and “kontratazioa” :

<script type="text/javascript">
  jQuery('#suckerfishnav li li a').text("");
</script>

It works, but it also deletes the img tag and children ul. I only want to remove the link text and have the other stuff remain.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:03:39+00:00Added an answer on May 30, 2026 at 8:03 pm

    First, block level elements are not valid inside a elements, i.e. you cannot put the ul element inside a.

    You can iterate over all children and only remove text nodes:

    jQuery('#suckerfishnav li li a').contents().each(function() {
        if(this.nodeType === 3) {
            this.parentNode.removeChild(this);
        }
    });
    

    or

    jQuery('#suckerfishnav li li a').contents().filter(function() {
        return this.nodeType === 3;
    }).remove()
    

    Reference: .contents, Node

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.