title: PHPDOM: how to edit style in HTML element
body: <p>I recently discovered PHPDom and found it very useful to manipulate HTML code. Unfortunately the documentation online is limited and there are no comprehensive PHPDom manuals that I am aware of. (There is no PHPdom tag in stockoverflow either!!)</p>
  
  <p>This is the problem I am experiencing.</p>
  
  <p>I would like to change the style an html tag, this is what I am using:</p>
  
  <pre><code>            $item = $dom-&gt;getElementById($name);
              $item-&gt;setAttribute('style', 'background-color:#FF0000;');
              $item = $dom-&gt;getElementById($name.'_error');
              $item-&gt;setAttribute('style', 'display:true;'); 
  </code></pre>
  
  <p>However the result of this code is that the styles defined in <code>$name</code> and <code>name.'_error'</code> are overwritten. </p>
  
  <p>To fix the problem, I am looking for a PHPdom method, something like editAttribute, that allows to edit an attribute without overwriting the existing style attributes for that element. </p>
  
  <p>Does anyone know how to fix this problem?</p>