Javascript onblur/onfocus
<p>I am having some trouble with the two events, they work fine, however I have ran into a problem:
I have a div inside of a div. When the inner div is in focus, I want a set of style buttons to be appended to the outer div. However when i try to click on the buttons, it unfocuses the inner div and makes the buttons go away. I want them to go away when focus is lost but I dont want focus to be lost when I press a button. Sorry if this is a little confusing here is some code and a jsfiddle of it in action:</p>

<pre><code>function addButtons() {
  var node = document.createElement('div');
  var obj = document.getElementById('container');
  node.setAttribute('id', 'buttons');
  node.innerHTML = '&lt;input type="button" value="B" onClick="document.execCommand(\'bold\',false)" /&gt;';
  obj.appendChild(node); 
}

function removeButtons(id) {
  var obj = document.getElementById('container');
  obj.removeChild(obj.childNodes[3]);
}
</code></pre>

<p><a href="http://jsfiddle.net/bnjGE/2/" rel="nofollow">http://jsfiddle.net/bnjGE/2/</a></p>

<p>If I remove the removeButtons() function, it works fine, but multiple buttons will be created.</p>

<p>I can try to clear things up, just ask.</p>

<p>Thankyou</p>
