.


:




:

































 

 

 

 





:

insertBefore(newChild, referenceChild);

appendChild(newChild).

newChild , appendChild() , insertBefore() ,
referenceChild.

, . , , false:

cloneNode(deeplone).

:

currentNode. removeChild (child) .

currentNode. replaceChild (newChild, oldChild) oldChild newChild.

currentNode, .

DOM

DOM style, . , <p>, document.getElementById("samplePtag").style.color = red.

CSS (http://www.w3.org/Style/CSS/#specs).

innerHTML outerHTML

, , , DOM innerHTML outerHTML. innerHTML HTML- . , . : COL, COLGROUP, FRAMESET, HTML, STYLE, TABLE, TBODY, TFOOT, THEAD, TITLE, TR.

innerHTML , ( <br>).

outerHTML , HTML- ,
.

: CAPTION, COL, COLGROUP, FRAMESET, HTML, TBODY, TD, TFOOT, TH, THEAD, TR.

outerHTML , , .. window.onload.

innerHTML outerHTML:

<!-- # 9: -->

<html><head>

<script type="text/javascript">

function transformBody() {

var myPar = document.getElementById("myP");

myP.innerHTML = "<i>Hello World!</i>";

myP.outerHTML = "<strong>" + myP.innerHTML

+ "</strong>";

}

</script>

</head>

<body onload="transformBody();">

<p id="myP">sample text</p>

</body>

</html>

<!-- body :

<BODY><STRONG><I>Hello World!</I></STRONG></BODY>

-->

innerHTML outerHTML , . outerHTML , (, Firefox).

Event Model

Event Model, JavaScript , .

, :

onblur , , ;

onchange , , ;

onclick , ;

ondblclick , ;

onfocus , , ;

onkeydown , ;

onkeypress , ;

onkeyup , ;

onload , ( ) ;

onmousedown , ;

onmousemove , ;

onmouseout , ;

onmouseover , ;

onmouseup , ;

onreset , ;

onselect , ;

onsubmit , ;

onunload , , .

HTML :

<a href=sample.html

onclick=alert(Links clicked)>click me</a>

<!-- # 10: -->

<html> <head>

<title>Test of Browser name</title>

</head>

<body>

<h1 align=center> </h1>

<hr>

, "Browser"

<P><hr><form name=fr>

<input type=button name=browser value=Browser

onClick="window.alert(window.navigator.appName)">

</form>

</body> </html>





:


: 2016-04-03; !; : 404 |


:

:

.
==> ...

1494 - | 1325 -


© 2015-2024 lektsii.org - -

: 0.01 .