Jump to content

Replacing a form element with text

Armed Rebel

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...