Mohamed Atef
Published in : 2022-01-27
Hello everyone, I am wondering How can I get a style attr of a specific element using jQuery and add it to another div? for example if I have element like
<div >...</div>
How can I add the same style to another div with class posts-container-custom?
Thanks.
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Joseph Morgan Date : 2022-01-27
Best answers
11
Best answers
11
Hi Mo, you can achieve what you need using this code to get the style attribute
then you can add the style to the second div using
so the entire code should looks like
Good luck
Mohamed Atef Date : 2022-01-27
Thank you Joseph, this logic makes sense & worked for me