Since CSS3 no get parent Selector...i will do it manually by myself$('p').each(f …

edited December 2018 in CSS

Since CSS3 no get parent Selector...i will do it manually by myself

$('p').each(function() {
  var className = $(this).attr('class');
  $(this).parent().addClass(className);
})

Am sure our grandchildren will have a simple and better solution

Comments

  • edited December 2018

    Most definitely!

  • AyoAyo
    edited December 2018

    lol

  • edited December 2018
    I have written code that has $ sign like this ehn, being over 12 months. Vanilla JS inside of react, vue is what I have been using, as a result of the tooling: I don't love including jQuery as a dependency in a node based development tool or something that manipulates the DOM.
  • edited January 1

    Variety is the spice of life. . . .

Sign In or Register to comment.