locked
LS HTML modifying the DOM RRS feed

  • Question

  • when you have a list on your screen , each row is a control and within each row you may have data elements.

    list

    --row

    ----name

    ----Order#

    and so on for repeating rows.

    if the name is the same, i'll like to keep the rows for that user together and hide the repeating name - with no margins between the rows

    I have managed to hide the repeating name but addstyles to the parent container is not working.

    in order to do that I need to be able to get the parentElement of the name element and assign a style to it.

    I tried $(element).parentElement.addClass("nospace") but it appears to be undefined ...

    any ideas on how to achieve this effect?

    MrP

    Wednesday, October 23, 2013 8:57 PM

All replies

  • Please provide more codes about get the parentElement of the name element and assign a style.  

    Wednesday, October 30, 2013 9:57 AM
  • Not sure you can chain jQuery and Javascript like that.  In all jQuery,

    $(element).parent().addClass("myClass");

    might work for you.

    Wednesday, October 30, 2013 1:42 PM