Thursday 4 July 2019

javascript - Change CSS rule in class using JQuery

You should be selecting an element with jQuery. You're aware that you aren't selecting the CSS class itself, correct?


Once you have an element with class="Foo", you can select it as you have, and either set css properties manually like you're trying to do, or you can use add class like so:



$(".Foo").addClass('Foo');


Granted of course, since you're selecting the same class that you're adding, it doesn't really make sense.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...