Sanjeev K Sanjeev K - 1 year ago 99
jQuery Question

add inline style to dynamically generated div using jquery

I am trying to add inline style to a div using jquery, following is the div as I inspect in firebug (attached below)

enter image description here

I want to keep the existing

as well, I just have to add
to the existing class, following jquery I've tried but no luck:

$(".testimonial_wrapper").css({'margin-left':'auto', 'margin-right':'auto'});

What are the other way to achieve? (please note that I am editing wordpress site and the divs are generated from page builders plugin)

Answer Source

I think you just have to erase the $ from function($) and change $to jQuery in the function itself:

   jQuery(".testimonial_wrapper").css({'margin-left':'auto', 'margin-right':'auto'});    
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download