problem with replaceChild

  • Thread starter biswaranjan.rath
  • Start date
B

biswaranjan.rath

Hi,

I'm facing problem after doing replaceChild for a DOCUMENT ELEMENT.

Sample code:

elem = document.getElementById( "myEle" );
var newVal;
newVal = document.createElement('textbox');
newVal.setAttribute( "id", "myEle" );
newVal.setAttribute( "value", "myValue" );
newVal.appendChild(document.createTextNode('Displaying Textbox'));
intAction.parentNode.replaceChild( newVal, elem );

after this, i'm trying to get the element again by
elem = document.getElementById( "myEle" );

But it returns NULL.


Please help.
Biswaranjan
 
M

Martin Honnen

biswaranjan.rath wrote:

elem = document.getElementById( "myEle" );
var newVal;
newVal = document.createElement('textbox');
^^^^^^^
What kind of document are you trying to script? HTML has textarea but
not textbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top