How do I use jquery to change every instance of "font-family: 'Arapey',sans-serif;" to "font-family: 'Arapey',serif;" in runtime?

Posted on 2014-08-02
Last Modified: 2014-08-02
Hi all,

could someone please tell me how I could use jquery to change every instance of "font-family: 'Arapey',sans-serif;" to "font-family: 'Arapey,serif';" in runtime on my page by force (maybe also with an ! important at the end)?

For some annoying reason in my wordpress site when I choose google font arapey it appends "sans-serif" at the back of it, which is completely wrong as it is a "serif" font and I want it like that.

thanks in advance
Question by:badwolfff
    LVL 58

    Expert Comment

    Are these inline styles?
    If not you would have to investigate the css of every element and change the inline style to the font.
    Not recommended.

    Might be easier to give us a link to the site to see what the problem is

    Author Comment

    Yes they are inline styles
    thanks for your message
    LVL 58

    Accepted Solution

    Try this in your document ready function


    Open in new window


    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now