Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Add javascipt to a blog article

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #239799
    jerryr125
    Participant

    Hi – When a blog article renders I need to execute the following javascript:

    $(‘table tr:contains(“Garage”)’)
    .addClass(‘garage’);
    $(‘table tr:contains(“Total Parking”)’)
    .addClass(‘totalparking’);
    $(‘p:contains(“view all”)’)
    .addClass(‘removeit’);

    How do I execute this in WordPress ?

    Note : from this blog post

    https://css-tricks.com/forums/topic/add-css-class-to-a-table/#post-239797

    #239826
    Shikkediel
    Participant

    Usually it’s done by wrapping the script in one of these :

    $(document).ready(function() { ... });
    

    If that’s too early in the process, this is the final event that could be used :

    $(window).on('load', function() { ... });
    
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.