javascriptɾ³ýÁÐ - Web ¿ª·¢ / JavaScript
´úÂëÈçÏ£º
<table>
<tr>
<td>µÚÒ»ÐÐ
</td>
</tr>
<tr>
<td><a href="javascript:delete()">ɾ³ý</a>
</td>
</tr>
</table>
<script>
delete()
{
//ɾ³ýÕâÒ»ÐУ¬ÇëÎÊÕâÀï´úÂëÔõôд£¿ Òª°ÑÕâÒ»ÐÐɾ³ý£¬»òÕß°ÑÕâÒ»ÐÐÒþ²ØÆðÀ´
}
</script>
<table>
<tr>
<td>µÚÒ»ÐÐ
</td>
</tr>
<tr>
<td><a href="javascript:delete(this)">ɾ³ý</a>
</td>
</tr>
</table>
<script>
function delete(sender)
{
sender.parentNode.parentNode.style.display = "none";
//ɾ³ýÕâÒ»ÐУ¬ÇëÎÊÕâÀï´úÂëÔõôд£¿ Òª°ÑÕâÒ»ÐÐɾ³ý£¬»òÕß°ÑÕâÒ»ÐÐÒþ²ØÆðÀ´
}
</script>
ͬÒâÂ¥ÉÏ!
ѧϰÁË¡¡
2Â¥µÄÄÜɾµô»òÊÇÒþ²ØÂð£¿Äã´«µÄ²ÎÊý¾Í²»¶Ô°¡¡£
ÈýÂ¥µÄÕâ¸öÓ¦¸Ã¿ÉÒÔ£¬
var entity=obj.parentNode.parentNode.parentNode.childNodes[0];
entity.parentNode.removeChild(entity);
Ïà¹ØÎÊ´ð£º
ÒÔÏÂÊÇÒ»¶ÎJavsScript½Å±¾£¬µ«ÔËÐÐʱ×Ü»á²úÉú ¡°Microsoft JScript ÔËÐÐʱ´íÎó: 'null' Ϊ¿Õ»ò²»ÊǶÔÏó¡±Òì³££¬´ó¼Ò°ï¿´Ò»Ï¡£
<form id="form1" runat="server">
< ......
ÎÒÔÚheadÖÐдÁËÏÂÃæµÃ´úÂë,Ïë½Ù³Öalertº¯Êý£¬¿ÉÊDz»ÖªµÀΪʲô£¬½«Õâ¸öhtml´ò¿ªÊ±£¬µ¯³öÁ½¸ö¿ò¶¼ÊÇÄÚÈݶ¼ÊÇab£¬ÎÒÒѾ½Ù³ÖÁËÕâ¸öº¯Êý£¬ÎªÊ²Ã´Ã»ÓÐЧÄØ£¿
ÎÒÔÚÏÂÃ涨Òå¸öbuttonÔÚonclickʼþÖÐÌí¼Ó´úÂëalert£¨¡°ab¡± ......
Çë½Ì¸÷λ´óÏÀ¡£
ÎÒÓÐÒ»Ò³Ãæa1.asp ÐèÒª´òÓ¡¡£ºáÏò£¬ÉÏ30£¬×ó5£¬ÓÒ5£¬ÏÂ5£¬Ò³Ã¼¡¢Ò³½ÅΪ¿Õ¡£
µ±Óû§µ½´ïa1.aspÒ³Ãæ¾Í×Ô¶¯ÉèÖÃÉÏÊöÃèÊö¡£À뿪a1.asp¾Í»Ö¸´Ä¬ÈÏÉèÖá£
Çë½Ì´óÏÀÃÇÈçºÎ±àÂ롣лл
û¿´Ã÷°×£¬ËµµÃ¸üÃ÷ ......
ÕâÀïÊÇһȺÈÈ°®¡¢²¢ÇÒÔ¸Òâ·ÖÏí֪ʶ¡¢°®ºÃ½»Á÷JavascriptµÄÈË¡£Èç¹ûÄúÕýÔÚѧϰʵ¼ù£¬²¢ÇÒÔ¸·ÖÏíÄãµÄѧϰÐĵúÍѧϰ³É¹û¸ø±ðÈË£¬¿ÉÒÔÉêÇë¼ÓÈëÎÒÃǵÄȺ£º100172168¡£ÄÜÔÙ½øÒ»²¿·ÖÈË
ÒýÓÃ
ÕâÀïÊÇһȺÈÈ°®¡¢²¢ÇÒÔ¸Òâ· ......
ÒÔÏÂÍøÒ³Ô´´úÂëÔÚFirefox¡¢Chrome¶¼Õý³££¬µ«µ½IE6¾Í²»ÐÐÁË£¬ºÎ½âÄØ£¿Âé·³´óÏÀÖ¸µãÖ¸µã£¡Ð»ÁË£¡Ï£Íû±£ÁôUTF8±àÂë~
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http ......