Jump to content

replace element


Miko

Recommended Posts

Hello,

 

i'm trying to replace a br tag.

I have this as code for the moment:

 

var br = document.getElementsByName("br");
                              br.parentNode.replaceChild(document.createElement("p"), br);

 

but I get this error: "br.parentNode is undefined"

 

Someone knows what I'm doing wrong here?

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/230207-replace-element/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.