Q:

How to remove textbox using dynamic id in javascript?

I have lots of dynamic textboxes with different ids. I am trying to remove them on click i have a function 
<script>
function removing(id){
    alert(id); 
    id.remove();
    }
</script>

and my html textbox
<input type="text" id="a" name="name" onclick="removing(this.id)" />

when i click on it. it gives alert box but not removing textbox any help?

A:

You need the element itself, so just pass this
<input type="text" id="a" name="name" onclick="removing(this)" />

And then the function can be
function removing(elm){
   alert(elm.id); 
   elm.parentNode.removeChild(elm);
}

You need to use removeChild from parentNode of element to remove it from DOM.

