proplem in delete child from div...?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
amira_fcis
Forum Newbie
Posts: 16
Joined: Sun Aug 16, 2009 7:59 am

proplem in delete child from div...?

Post 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);
}
User avatar
Popcorn
Forum Commoner
Posts: 55
Joined: Fri Feb 21, 2003 5:19 am

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

Post by Popcorn »

the textbox is not a child of "newdiv".
Post Reply