skip to Main Content

Html – Console log not showing the attribute

I am using below HTML for my code. <body> <div id="myId" class="oldClass"> This is the original content of the element with ID "myId". </div> </body> I am perform DOM Manipulation using below JavaScript Code: const myElement = document.getElementById('myId'); myElement.setAttribute('data-example', 'value');…

VIEW QUESTION

And selector referencing parent selector twice in SCSS

I want to do in SCSS something quite simple in vanilla CSS: targeting an element that has two classes. A simplified example is below: <div class="parent"> <div class="child"></div> <div class="child child--red"></div> <div class="child child--green"></div> <div class="child child--red child--green"></div> </div> I…

VIEW QUESTION
Back To Top
Search