Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- .myhover {
- width: 120px;
- }
- .myhover:hover p{
- color: #FED242!important;
- }
- </style>
- <div id="divParent" class="myhover">
- <p>Some text</p>
- <p>Text text text</p>
- <div id="divChild" class="myhover">
- <p>Example text</p>
- </div>
- </div>
- <script>
- $(document).ready(function(){
- $(".myhover p").hover(function(){
- $(this).parent().children("p:not(:last)").css("background-color","#FED242");
- });
- });
- .myhover p:last-of-type {
- background-color:#FED242 !important;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement