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

  • SEARCH
  • Home
  • 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 8928261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:23:49+00:00 2026-06-15T08:23:49+00:00

I have so many modules and I am showing border to each module. Below

  • 0

I have so many modules and I am showing border to each module.

Below is what I have

div.ja-moduletable-inner,
div.moduletable-inner {
  background: none;
  padding: 1.5em;
  box-shadow: 0px 0px 3px 3px rgba(0,0,0,.25);
}
<div id="Mod143">
    <div class="moduletable-inner clearfix"> ... </div>
</div>
<div id="Mod148">
    <div class="moduletable-inner clearfix"> ... </div>
</div>
<div id="Mod149">
    <div class="moduletable-inner clearfix"> ... </div>
</div>

Note : These modules are added by-default by Joomla, so I can’t handle this. What I want is using Javascript, I want to add class in Mod149 so that I will have it as

<div id="Mod149">
    <div class="moduletable-inner clearfix newMyOwnClass">`
                                           ^^^^^^^^^^^^^^
</div>

and I will have in css as

div.newMyOwnClass {
  box-shadow: 0px 0px 0px 0px rgba(0,0,0,.25);
                      ^^^^^^^
}

Any idea how to add this class to the element inside <div id="Mod149"> in Javascript (no jQuery!)?

  • 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-06-15T08:23:50+00:00Added an answer on June 15, 2026 at 8:23 am

    2 ways to approach your problem:

    1. Pure CSS

    Just increase the specifity of your selector:

    #Mod149 > div.moduletable-inner {
       box-shadow: 0px 0px 0px 0px rgba(0,0,0,.25);
    }
    

    2. Using JavaScript

    To add the class either use the classList.add method, or update the className attribute:

    var elem = document.querySelector('#Mod149 > .moduletable-inner');
    if (elem) {
        elem.className += ' newMyOwnClass';
    }
    

    To insert the CSS, either inject a <style> tag, or use a styleSheet’s insertRule method. The last method does not work when the stylesheet originates from a different origin, so I recommend the first approach:

    var head = document.getElementsByTagName('head')[0];
    var style = document.createElement('style');
    var css = ['div.newMyOwnClass {',
               '    box-shadow: 0px 0px 0px 0px rgba(0,0,0,.25);',
               '}'].join('\n');
    head.appendChild(style);
    
    if (style.styleSheet) {
        /* This is for IE-users.*/
        style.styleSheet.cssText = css;
    } else {
        style.appendChild(document.createTextNode(css));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup where i load many modules as required, each module has
I have an internationalized project with many modules. Each module has its own set
I have many modules. One module loads another module, which loads another module. Etc...
Background: We have a project with many modules. We're using EntityFramework 4.2 with FluentAPI
I have quite a large VB6 project, with many forms, classes, modules and user
We have many projects with several files inside each. Files can be checked in
I have many text files containing bank transactions in the middle of them. Each
Imagine I have a model called Course and each course has_many Modules . However
I have seen many projects using simplejson module instead of json module from the
I currently have Zend setup to look for a layout script in each module's

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.