I have this CSS code:
#texte>div:not(:last-child)>p:not(.show){
display:none;
}
And I need to write javascript in order to change the style to match the above css. I honestly have no idea how to get to this kind of selectors using js.
<style>tag), or select the elements manually (jQuery and similar libraries support selecting using CSS syntax)#texte ... { display: none }; #texte.open ... { display: block }). Alsodocument.querySelector()ordocument.querySelectorAll().#texteis a table div and its divs are table-cells. I got too much text in some of the cells (all except the last) so I hide it and put a "more.." button. Theshowclass are thepelements containing the text that will still be displayed before clicking the "more" button. Obviously, at some point, the text should restore the attributes above, so that's where I need helpsnip(or similar) class to all the divs which should be reduced, and remove this class via JavaScript when the show button is pressed. No need to change styles via JavaScript at all.