Jump to content

Replacing a form element with text


Recommended Posts

Hi, I'm working on a spelling function that, when an incorrect word is found, it creates a dropdown box with the suggestions. When you change it, it replaces the word in the post box, and the select is replaced with the user's choice. The problem I'm having is with the replacement of the select/text. The problem being I have no idea how to do it, and I've looked everywhere with the help of google.This is all I've got (ignore the id):

var c = document.getElementById("word"+id2+"."+id1);	c.parentNode.removeChild(c);

I had to code to add in a "text node", but that puts text in the <select> tag, so it's removed with the above code.Thanks for any help.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...