From the question itself, I am sure you understand that I am not an angular/jquery expert.
I have a div generated using angular which looks like this:
<div id='my-div' style={{ang.style}}'>
This is content inside the div
</div>
As you can see the style for the div comes from angular. Is there any way I can get this value in jQuery?
If I do $('#my-div').attr("style")
it just prints {{ang.style}}
I know this is not the right way to do it, but currently due to many constraints, I need to be able to get this value in jQuery at least as a temporary fix.
I hope the Angular/JQuery Gurus here will be able to help me...
您应该在jQuery中使用.css()
而不是.attr("style")
来获取计算属性。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.