i have a question, can i replace html tag to another ?
But i don\'t want to make the content blank. like this:
content<
No. You cannot change the tagName (nodeName) of a DOM node.
You only could create a new node of the wanted type, copy all attributes (and maybe properties) and move the child nodes. Yet you would loose inaccessible things like attached event listeners. This technique is for example used when you want to change the type of an input in IE.
However, there is absolutely no reason to change an a
into a div
, they have completely different semantics (also behaviour and layout).