Page 1 of 1

proplem in delete child from div...?

Posted: Tue Dec 29, 2009 7:37 am
by amira_fcis
hi all,
i have

Code: Select all

<td><div id="newdiv"></div></td>
<?for($i=0;$i<count($exploded_location);$i++){?>
                                
                                <tr><td><input type="text" name="featurevalue<?echo ($i*2)+10;?>" value="<?echo $exploded_location[$i];?>" ></td>
                                <td><a href="javascript&#058;deleteNear(featurevalue<?echo ($i*2)+10;?>)" >Remove</a></td>
                                </tr>
                                <?}?>   
which suppose to make textbox and beside it a href "Remove" ...the problem is when i click Remove it didnot remove the textbox...i donot know why..?
here is the function deleteNear()

Code: Select all

function deleteNear(divID)
{
 
var ni = document.getElementById('newdiv');
ni.removeChild(divID);
}

Re: proplem in delete child from div...?

Posted: Fri Feb 12, 2010 3:15 am
by Popcorn
the textbox is not a child of "newdiv".