Accessing text-elements with Java

  • 14 February 2018
  • 0 replies
  • 548 views

Hello everybody,

I faced the following issue today: I tried to create the basic script in Java that changes the background-color of a box when hovering it with the mouse as well as the color of the text-elements that are inside of this box.

Here’s a part of that code:

      let hoverRight = $("#lp-pom-box-111").on("mouseover", function(){
          $("#lp-pom-box-111").css("background-color", "#142D5A");
          $("#lp-pom-text-112").css("color", "#FFFFFF");
          $("#lp-pom-text-113").css("color", "#B9C0CE");
      });

There’s no problem accessing the box and adapting the css but it doesn’t work for the text-elements. I even tried to trigger that effect when I hover the elements but it still won’t work.

    let hoverRightText = $("#lp-pom-text-113").on("mouseover", function(){
         $(this).css("color", "#FFFFFF");
    });

I’m new to Java so can someone please give me a heads up what I missed? Thank you!


0 replies

Be the first to reply!

Reply