Jump to content

Adding CSS with jQuery


Solarpitch

Recommended Posts

Hey Guys,

 

I have a div with a data attribute of id. I can get the value fine ("278715"). How can I add a class to this div using jQuery.

 

<div class="ppc_result" data-id="278715"></div>

 

Here's what I'm trying but doesnt seem to work.

 

$("data-id").val(videoData['id']).addClass('ppc_thumb_playing');

Link to comment
https://forums.phpfreaks.com/topic/249035-adding-css-with-jquery/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.