Remove preceeding tag

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-03-22T11:34:20Z Indexed on 2010/03/22 11:41 UTC
Read the original article Hit count: 328

If there is a tag as <p id="name" onclick="javascript:var ele=context(this);">sumtext here</p><br>
<p id="name" onclick="javascript:var ele=context(this);">newtext here</p><br>

   <script>
    function context(obj)
     {
         var b = document.getelementbyID("area");
         b.removeChild(obj);
         //How to remove the preceeding element i.e,<br>
     }
   </script>

    <textarea id='area' rows="4" cols="70"></textarea>

<p> and <br> are not in a div and so if i remove <p> how to remove the preceding tag br from javascript

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about javascript-events