diff --git a/Haste/App/Perch.hs b/Haste/App/Perch.hs
--- a/Haste/App/Perch.hs
+++ b/Haste/App/Perch.hs
@@ -255,7 +255,7 @@
 src= atr "src"
 
 
----------------- DOM Tree navigation
+---------------- DOM Tree navigation and edition
 
 -- | return the current node
 this :: Perch
@@ -268,6 +268,17 @@
   p <- liftIO  $ parent e
   e2 <- build pe' p
   return e2
+
+-- | replace the current node with a new one
+outer ::  Perch -> Perch -> Perch
+outer olde  newe= Perch $ \e'' -> do
+   e  <- build olde e''
+   e' <- build newe e''
+   liftIO $ replace e e'
+
+replace :: Elem -> Elem -> IO Elem
+replace= ffi $ toJSString "(function(e,e1){var par=  e.parentNode;par.replaceChild(e1,e);return e1;})"
+
 
 -- | delete the current node. Return the parent
 delete :: Perch
diff --git a/Haste/Perch.hs b/Haste/Perch.hs
--- a/Haste/Perch.hs
+++ b/Haste/Perch.hs
@@ -265,7 +265,7 @@
 src= atr "src"
 
 
----------------- DOM Tree navigation
+---------------- DOM Tree navigation and edition
 
 -- | return the current node
 this :: Perch
@@ -289,6 +289,17 @@
 -- | delete the children of the current node.
 clear :: Perch
 clear= Perch $ \e -> clearChildren e >> return e
+
+-- | replace the current node with a new one
+outer ::  Perch -> Perch -> Perch
+outer olde  newe= Perch $ \e'' -> do
+   e  <- build olde e''
+   e' <- build newe e''
+   replace e e'
+
+replace :: Elem -> Elem -> IO Elem
+replace= ffi  "(function(e,e1){var par=  e.parentNode;par.replaceChild(e1,e);return e1;})"
+
 
 
 parent :: Elem -> IO Elem
diff --git a/haste-perch.cabal b/haste-perch.cabal
--- a/haste-perch.cabal
+++ b/haste-perch.cabal
@@ -1,5 +1,5 @@
 name: haste-perch
-version: 0.1.0.8
+version: 0.1.0.9
 cabal-version: >=1.10
 build-type: Simple
 license: GPL-3
