Forums

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

Home Forums JavaScript jQuery Question Re: jQuery Question

#79947
dcp3450
Participant

you can use the class from the body when on the home page:

<body class="home page page-id-4 page-template page-template-default">

you can do something like:

if($(‘body[class$="home"]’))
{

}

This checks the class attribute to see if home is listed. if so only the code inside the if statement will execute.