tags:

views:

389

answers:

1

hi,

I am having a list like

     <li style="display: list-item;" id="listChoices">
      <label class="topspace">Enter the Choices</label>
    <input value="Choice1" maxlength="150" id="Choice1"/>
   <input value="Choice2" maxlength="150" id="Choice2"/>
   <input value="Choice3" maxlength="150" id="Choice3"/>

     </li>

I want to delete the input tag alone so i tried it with

$("#listChoices").empty(); // which removes the entire content of the list . But i want to remove only the input elements so i tried it with

    $("#listChoices input").empty();//But its not working..Why so???
+3  A: 

Try:

 $("#listChoices input").remove();

Which will remove the tags. empty() will simply clear the innerHTML.

peirix
Ya it works now..
Mercy
Ah, was a tad bit too slow :)
googletorp