3

I'm trying to disable this css rule on a single page:

[id^="ITEMROW_"]:hover
{
  background-color: #F6F6F6 !important;
}

Using the following jQuery:

$("id^=ITEMROW_").css("hover", "");

However, it is not working. The css code is still being applied.

Can someone help with this?

2

1 Answer 1

3

This is because hover is a pseudo class not a property. You can't directly edit the pseudo class in jquery. Because it's not technically part of the DOM and therefore is inaccessible by any JavaScript. But you can add a new class with a new :hover specified.

Like

[class^="newclass"]:hover
{
  background-color: #F6F6F6 !important;
}

and toggle it

$('#ITEMROW_').toggleClass('newclass');
Sign up to request clarification or add additional context in comments.

1 Comment

hope this will solve your query. if require more help just ask

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.