title: How to check if an element has CSS and If so Update its parent with those?
body: <p>I need to check whether <code>&lt;img&gt;</code> has defined inline <code>css</code> property, and if so It need to update its parent with those <code>css</code> and need to remove orginal css declaration.</p>
  <p>This is how I tried it:</p>
  <pre><code>var $el = $('.article &gt; img');
  $el.each(function () {
    if ($(this).css(&quot;float&quot;) == &quot;left&quot;) { $(this).parent().css(&quot;float&quot;,&quot;left&quot;); }
    if ($(this).css(&quot;float&quot;) == &quot;right&quot;) { $(this).parent().css(&quot;float&quot;,&quot;right&quot;); }
  })
  </code></pre>
  <p>My img tag would have css for <code>float</code> or <code>margin</code> and somethime both or none of them. My above code is working for only for one rule.</p>
  <p>Can anybody tell me how do it for both <code>CSS</code> rules?</p>