HTMLʼþ
תÔØ£ºhttp://jiangzhengjun.javaeye.com/blog/480996
ʼþ
DOMͬʱ֧³ÖÁ½ÖÖʼþģʽ£º²¶»ñÐÍʼþºÍðÅÝÐÍʼþ£¬µ«ÊÇ£¬²¶»ñÐÍʼþÏÈ·¢Éú¡£Á½ÖÖʼþÁ÷»á´¥¼°DOMÖеÄËùÓжÔÏ󣬴Ódocument¶ÔÏó¿ª
ʼ£¬Ò²ÔÚdocument¶ÔÏó½áÊø£¨´ó²¿·Ö¼æÈݱê×¼µÄä¯ÀÀ»á¼ÌÐø½«Ê¼þ²¶»ñ/ðÅÝÑÓÐøÖÁwindow¶ÔÏ󣩣¬DOMÖеÄÔªËض¼»áÁ¬ÐøÊÕµ½Á½´Îʼþ£¬Ò»´ÎÔÚ
²¶»ñ¹ý³ÌÖУ¬ÁíÒ»´ÎÔÚðÅݹý³ÌÖС£DOMʼþÄ£ÐÍ×î¶ÀÌصÄÐÔÖÊÊÇ£¬Îı¾½ÚµãÒ²´¥·¢Ê¼þ£¨ÔÚIEÖв»»á£©¡£µã»÷Îı¾½ÚµãʼþÁ÷Ó¦¸ÃÈçÏÂͼ£º
´«Í³Ê¼þ´¦Àíº¯ÊýÓÐÁ½ÖÖ·ÖÅ䷽ʽ£ºÔÚJavaScriptÖлòÕßÔÚHTMLÖС£
ÔÚJavaScriptÖзÖÅäʼþ´¦Àíº¯Êý£º
Js´úÂë
var
oDiv = document.getElementById(
"div1"
);
oDiv.onclick = function
() {
alert("I was clicked"
);
};
var oDiv = document.getElementById("div1");
oDiv.onclick = function () {
alert("I was clicked");
};
×¢£ºÔÚÕâ¸ö·ÖÅä·½·¨£¬Ê¼þ´¦Àíº¯ÊýÃû³Æ±ØÐëСд£¬²ÅÄÜÕýÈ·ÏìӦʼþ¡£
ÔÚHTMLÖзÖÅäʼþ´¦Àíº¯Êý£º
Html´úÂë
<
div
onclick
=
'alert("I was clicked")'
>
</
div
>
<div onclick='alert("I was clicked")'> </div>
˵Ã÷£ºÓÃÕâÖÖ·½·¨£¬Ê¼þ´¦Àíº¯ÊýµÄ´óСд¿ÉÈÎÒ⣬ËùÒÔonclickµÈͬÓÚonClick¡¢OnClick»òONCLICK£¬µ«±ê×¼µÄÊÂ
¼þ´¦Àíº¯ÊýÓ¦¸ÃÈ«²¿ÓÃСд¶¨Òå¡£
˵Ã÷£º´«Í³·ÖÅ䷽ʽÓиöȱÏݾÍÊÇÖ»ÄÜ·ÖÅäÒ»¸ö´¦Àíº¯Êý¡£ÓÚÊǾͳöÏÖÁËÆäËüÒÔÏ·ÖÅ䷽ʽ¡£
IEÖÐÌØÓеÄattachEvent()ʼþ´¦Àíº¯Êý·ÖÅä·½
ʽ£º
Js´úÂë
var
fnClick1 =
function
() {
alert("Clicked!"
);
};
var
fnClick2 =
function
() {
alert("Also clicked!"
);
};
var
oDiv = document.getElementById(
"div"
);
oDiv.attachEvent("onclick"
, fnClick1);
Ïà¹ØÎĵµ£º
´°¿Úʼþ (Window Events)
½öÔÚ body ºÍ frameset ÔªËØÖÐÓÐЧ¡£
ÊôÐÔ Öµ ÃèÊö
onload ½Å±¾ µ±ÎĵµÔØÈëʱִÐнű¾
onunload ½Å±¾ µ±ÎĵµÐ¶ÔØʱִÐнű¾
±íµ¥ÔªËØʼþ (Form Element Events)
½öÔÚ±íµ¥ÔªËØÖÐÓÐЧ¡£
ÊôÐÔ Öµ ÃèÊö
onpropertychange ½Å±¾ µ±Îı¾ÄÚÈݸıäʱִÐнű¾
onchange ½Å± ......
תhttp://topic.csdn.net/u/20100121/13/8DD559AF-FED9-42D5-9A15-FB974F03068A.html
ºÇ,È˳ª¸èµÄ,ÅĵçÓ°µÄŪºÃ×÷Æ·Òª¸ã·¢²¼»á,ÎÒҲѧϰÁËÃû´Ê,Ò²¸ã³ÌÐò×÷Æ··¢²¼»á
¸÷λͬÈÊ,×öºÃÐÄÀí×¼±¸^-^
ÒòΪ,Äú¼´½«¿´µ½ºÍÍæµ½,Ò»¸ö×ãÒÓÁíÄã´ó¿ªÑÛ½ç/¶úĿһеÄÆæÃî³ÌÐò.
±¾ÓÎÏ·½öÐè128MÄÚ´æµÈ¹Å¶ÅäÖÃ,Èç¹ûÄãÊÇ2GÄÚ´æ/Ë«ºË/Ëĺ ......
CSDN²©¿Í£ºhttp://writeblog.csdn.net/PostList.aspx
·½·¨Ò»£ºÓüÇʱ¾´ò¿ªindex.htm£¬Ìæ»»£º10pt ---> 12pt£¬±£´æºó£¬ÓÃIE´ò¿ª´Ëhtm£¬ctrl+a--ctrl+c£¬Õ³Ìùµ½²©¿Í¾ÍÐÐÁË£¡
·½·¨¶þ£ºÔÚcsdn·¢±íÎÄÕÂʱ£¬Ñ¡Ôñ¡¾Í¼Ïñ¡¿ºóÃæµÄ¡¾HTML¡¿°´Å¥£¬ÔÙ°Ñindex.htmÔ´ÂëÕ³ÌùÉÏÈ¥£¬Ê²Ã´Ò²²»ÓøĶ¯£¡ ......
//½ØÈ¡²¿·ÖÄÚÈÝ·½·¨
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// È¥³ýHTML±ê¼Ç
&nb ......