Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javascriptÖÐidºÍname - Web ¿ª·¢ / JavaScript

Ë­ÄܸøÎÒ½²Ò»ÏÂÔÚjavascriptÖÐidºÍnameÓÐʲôÑùÇø±ð£¿
Ò»¸öÒ³ÃæÖÐ id×îºÃÖ»ÓÐÒ»¸ö ÒòΪ javascript ÓÐ getElementById("id")Ö®ÀຯÊý
name ¿ÉÒÔÓжà¸ö ³£ÓÃÔÚÌá½»ÇëÇóÊ·þÎñÆ÷¶Ë»ñÈ¡

Ò»¸öÔªËØÖÐ×îºÃÉèÖà id Óë name Ãû×ÖÏàͬ



idÖظ´ÁË£¬ºÃÏñÕû¸öjavascript´úÂ붼ûÓÐ×÷ÓÃÁË

¶ÔÓÚ id Óà document.getElementById("nodeId"),ÇÒ id ²»ÄÜÖظ´£¬·µ»ØÒ»¸öΨһµÄÔªËØ£¬¶ø¶ÔÓÚ name ¿ÉÓà document.getElementsByName("sNodeName"), ·µ»ØÒ»¸öÔªËØÊý×é(¾ßÓÐÏàͬÃû×ÖµÄËùÓнڵã)£»


¹ËÃû˼Òå°É£º

name Ãû×Ö
id ±àºÅ£¨Éí·ÝÖ¤ºÅÂ룩

ͬһ¸ö°à¼¶£¬Í¬Ò»Ñ§Ð££¬¿ÉÒÔÓÐÈô¸É¸öͬÃû×Ö£¨name£©µÄÈË£»
µ«ÊÇÿ¸öÈË£¬¼´Ê¹ÐÕÃûÒ»Ñù£¬µ«ÊÇËûÃǵıàºÅ£¨id£©ÊDz»Ò»ÑùµÄ¡£

nameÖ÷ÒªÊǸøform(±íµ¥)ʹÓ㬶àÑ¡¿ò¡¢¸´Ñ¡¿ò¾Í»á¹«¹²Ò»¸öname£¬submitµÄʱºò¾Í»á°´name=valueµÄ¸ñʽÌá½»¸ø·þÎñÆ÷¡£
HTML code:
<input name="gender" type="radio" value="1" />ÄÐ<input name="gender" type="radio" value="2" />Å®


idÖ÷ÒªÊÇÓÃÀ´±íʾ±êÇ©µÄΨһÐÔ£¬name¿ÉÒÔ±íʾһÀ࣬ÔÚjsÖбíʾһÀà±êÇ©£¬Ï൱ÓÚjqueryÖеÄclass

ÒýÓÃ
idÖ÷ÒªÊÇÓÃÀ´±íʾ±êÇ©µÄΨһÐÔ£¬name¿ÉÒÔ±íʾһÀ࣬ÔÚjsÖбíʾһÀà±êÇ©£¬Ï൱ÓÚjqueryÖеÄclass
ooo

Õâ²»ÊÇjsµÄ¸ÅÄÊÇhtmlµÄ¸ÅÄî¡£nameÖ÷ÒªÓÃÓÚ±íµ¥ÔªËغͳ¬Á´½ÓÔªËØ£¬ËüºÃ±ÈÈ˵ÄÃû×Ö£¬ÖØÃûµÄ¶àÁËÈ¥Á


Ïà¹ØÎÊ´ð£º

JavaScript½Ù³Ö - Web ¿ª·¢ / JavaScript

ÎÒÔÚheadÖÐдÁËÏÂÃæµÃ´úÂë,Ïë½Ù³Öalertº¯Êý£¬¿ÉÊDz»ÖªµÀΪʲô£¬½«Õâ¸öhtml´ò¿ªÊ±£¬µ¯³öÁ½¸ö¿ò¶¼ÊÇÄÚÈݶ¼ÊÇab£¬ÎÒÒѾ­½Ù³ÖÁËÕâ¸öº¯Êý£¬ÎªÊ²Ã´Ã»ÓÐЧÄØ£¿
ÎÒÔÚÏÂÃ涨Òå¸öbuttonÔÚonclickʼþÖÐÌí¼Ó´úÂëalert£¨¡°ab¡± ......

Java Javascript JspµÄÇø±ðºÍ±È½Ï - Java / JavaÏà¹Ø

ÎÒѧµÄÊÇC++,¶ÔÓÚJava²»ÊǺÜÁ˽⡣×î½ü¿´ÁËJava·½ÃæµÄÊ飬¶ÔÓÚһЩ¸ÅÄîÓÐÁ˳õ²½Á˽⣬ϣÍû´ó¼ÒºÍÎÒÁÄÁÄ£¬Ì¸Ì¸Java £¬JSP JavaScriptÕ⼸¸ö¸ÅÄî¡£
1. javascriptºÍCSS, HTMLÒ»Æ𽫻ᷢË͸øä¯ÀÀÆ÷½øÐÐÖ´ÐУ¬×îÖÕ½«Ò³Ã ......

javascript³õѧÕߣ¬½»Á÷ - Web ¿ª·¢ / JavaScript

ÕâÀïÊÇһȺÈÈ°®¡¢²¢ÇÒÔ¸Òâ·ÖÏí֪ʶ¡¢°®ºÃ½»Á÷JavascriptµÄÈË¡£Èç¹ûÄúÕýÔÚѧϰʵ¼ù£¬²¢ÇÒÔ¸·ÖÏíÄãµÄѧϰÐĵúÍѧϰ³É¹û¸ø±ðÈË£¬¿ÉÒÔÉêÇë¼ÓÈëÎÒÃǵÄȺ£º100172168¡£ÄÜÔÙ½øÒ»²¿·ÖÈË

ÒýÓÃ
ÕâÀïÊÇһȺÈÈ°®¡¢²¢ÇÒÔ¸Òâ· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ