Delete the CSS class attributes from the child elements in the list

I need help creating an unordered list in HTML with a CSS class attached to the "ul" element and its child "li" elements. The problem arises when another unordered list becomes a child element of this parent unordered list.

Here is a sample code snippet showcasing my issue:

Javascript:

$(function () {
    $('.marquee').marquee({

        duration: 10000,
        duplicate: false,
        delayBeforeStart:0,

        allowCss3Support: true,
        gap: 600,

    });
   });

HTML:


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.marquee/1.3.1/jquery.marquee.min.js"></script>
<ul class='marquee'>
    <li>1. Longer text lorem ipsum dolor sit amet, <h3>consectetur adipiscing elit END</h3></li>
    
    <li>2. Longer text lorem ipsum dolor sit amet, consectetur adipiscing elit END</li>
    
    <li>3. Longer text lorem ipsum dolor sit amet, consectetur adipiscing elit END</li>
    
    <li>4. Longer text lorem ipsum dolor sit amet, consectetur adipiscing elit END</li>
    
        <li><ul><li><b>I'm the Child Unordered List Element. I don't want this CSS</b></li></ul></li>
</ul>

CSS:


body {
    margin: 10px;
    font-family: 'Lato', sans-serif;
}
.marquee {
    width: 100%;
    overflow: hidden;
    border: 1px solid #ccc;
    background: black;
    color: rgb(202, 255, 195);
}
ul.marquee li {
    display: inline-block;
    padding: 10px 20px;
}

Jsfiddle

Can anyone suggest how to remove the CSS class "marquee" from the Child Unordered List?

Thank you in advance.

Answer №1

Kindly provide the code mentioned in your question. Based on my understanding of your statement, the following code can accomplish what you are looking for (remember to replace '.xyz' with the actual class):

jQuery("ul.xyz").find("ul.xyz").removeClass(".xyz");

Answer №2

Observation: The ul inside the main ul is not enclosed within an li. It is important to place any child element in a list as a descendant of an li element.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How can I display a JSON object as a table in Sinatra?

When working with Sinatra, an Ajax action returns a JSON object. I am trying to display this data in a table within my view. The JSON object includes a list of items that need to be shown. One approach is to render the table using JavaScript. This would i ...

Problem with ngStyle: Error indicating that the expected '}' is missing

I encountered an error in the Chrome console when trying to interpret the code below: <div [ngStyle]="{'width': '100%'; 'height': '100%'; 'background-size': 'cover'; 'background-repeat&ap ...

Perform basic arithmetic operations on the output of SQL queries or on information stored in a datatable

Consider a scenario where a query yields results like the following... **TYPE** **TOTAL** A 2 B 4 Now, if you want to perform calculations such as A/(A+B) -> 2/(2+4) and display the result on your website, would it b ...

I'm attempting to utilize AJAX to modify the sorting and ordering arguments in a WP_Query, yet I'm struggling to pinpoint the reason behind the failure of my code

After hours of non-stop work, about 6 solid hours with no breaks, I am baffled as to why this code isn't working. Let's take a look at the form in question: <div id="wp-ajax-filter-search" class="full"> <form ...

How to implement form modal binding using Laravel and Vue.js

There are two models named Tour.php public function Itinerary() { return $this->hasMany('App\Itinerary', 'tour_id'); } and Itinerary.php public function tour() { return $this->belongsTo('App\Tour', ...

Instructions for using Selenium to access the "stats for nerds" option on a YouTube video by right-clicking

I am currently working on a program that has the ability to block YouTube ads and keep track of the blocked Ad Video IDs. To achieve this, our selenium program needs to simulate a right click on the video to open the video menu and then select "stats for ...

What is the correct location for me to store a text file so that AJAX can access it successfully?

After diving into a textbook to learn AJAX, I encountered an introductory exercise that required running some code. However, on line 16, there seems to be an issue with a GET request to retrieve a .txt file. Where exactly should I place the text file - i ...

Is there a way to ensure that the html is saved when using setTimeout in jquery

Attempting to preserve a specific piece of HTML code, which is displayed when hovering over an element. This overlay HTML content is extracted from a DOM template. When moving the mouse cursor away, I aim to retain the overlay HTML content for the curren ...

Leveraging Node.js to fetch data from a third-party website API using JSON

This particular code is currently not functioning properly as it is unable to retrieve an address from an external website We need the "result" value that is present in that json file. Is there a straightforward solution for this issue, such as enabling ...

Eliminate the space beneath the panel header in Bootstrap version 3.3.4

Can anyone help me understand why there is extra padding appearing under the drop-down select list in my panel header? picture <div class="panel panel-default"> <div class="panel-heading clearfix"> <h3 class="panel-title pull-l ...

A dynamic search feature implemented with PHP, MySQL, and AJAX

I have implemented an ajax call to fetch data from my mysql database when searching for users. Below is the corresponding html code; <input type="text" id="partnerName" name="partnerName" class="form-control" placeholder="Type to search partners...."& ...

Tips for excluding a value in a Vue loop

Is there a way to exclude the value "Three" from the loop in the following code snippet? <script > const routes = [ {name: 'One', value: 24}, {name: 'Two', value: 25}, {name: 'Three', value: 26}, {name: ...

Transform an Array into a String using Angular

Is there a more efficient way to extract all the state names from the array (testArray) and convert them to strings ('Arizona','Alaska','Florida','Hawaii','Gujarat','Goa','Punjab'...)? ...

Jasmine: Ways to invoke a function with a specific context parameter

Looking for guidance as a newbie to Jasmine on calling a method with context as a parameter. Example: function locationInit(context) { } Appreciate any help and advice! ...

Issues with the alignment of card-footer in Bootstrap 5 card components

Looking to enhance the website for the electronics store I am employed at, I have encountered a challenge while constructing cards using Bootstrap 5. Initially, the cards varied in height until I managed to resolve the issue by setting the card height to 1 ...

Error: express is missing a closing parenthesis for the argument list

When running this code in the VS Code terminal, be sure to verify any errors that may occur. var express = require('express'); var app = express(); app.get('/', function(request, response) { response.send("hello world"); }); app.li ...

Utilizing jQuery BBQ for Seamless Transitions – From Fading to Sliding and More

This is my first time posting a question here, even though I am an active user of stackoverflow. I have developed a website using jQuery BBQ to load pages through AJAX while still maintaining the ability to track history with the back button and other fun ...

What is the best way to display <br> using an ajax response?

ajax.php foreach ($errors as $e) echo "<br>".$e; // not functioning correctly echo $e."<br>"; // not working properly echo "\n\n".$e; // no desired effect echo $e."\n\n"; // issue with line breaks My java ...

Ways to refresh a div element without causing it to blink

I'm new to web development and I have an HTML webpage that retrieves data from a database and displays information based on the retrieved data. I would like to update the data every second without causing the webpage to blink. Can you please modify th ...

developing a star rating system for a mobile website

Can star ratings be implemented in a mobile website using HTML, CSS, and JS? The HTML code for the stars is as follows: <div class="rating"> <span>☆</span><span>☆</span><span>☆</span><span>☆</sp ...