How to change css of div having dynamic ID

Discussion in 'HTML and CSS' started by shajiuddin, Nov 19, 2019.

  1. shajiuddin

    shajiuddin

    Joined:
    Nov 19, 2019
    Messages:
    1
    Likes Received:
    0
    Hi,

    I have a div, ID is changing dynamically on each page load/refresh page like below

    indicator-total-amountt-comp370Label
    indicator-total-amountt-comp399Label
    indicator-total-amountt-comp640Label....keep changing

    Is it possible that I could read the starting characters "indicator-total-amountt-comp" and not the full ID than change the css?

    Any help will be highly appreciable


    Regards
     
    shajiuddin, Nov 19, 2019
    #1
    1. Advertisements

  2. shajiuddin

    sunfighter

    Joined:
    Nov 27, 2019
    Messages:
    102
    Likes Received:
    12
    This question makes very little sense. By ID are you talking about an HTML attribute? If yes they are really long and I am wondering why. Do they really need that length? How are you planing on reading the ID and changing the css? No just identifying the "indicator-total-amountt-comp" and changing the css is the same as randomly changing the css without identifing anything.

    Wouldn't the css depend on the number in the ID?
     
    sunfighter, Nov 27, 2019
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.