Javascript编程小结(3 css property, Event...)

DHTML: Scripting CSS Styles

Property

Description/Values

position

How the element is positioned. absolute, relative, fixed, or static (the default).

left, top

The X and Y coordinates of the left and top edges of the element.

width

The width of the element.

height

The height of the element.

zIndex

The stacking order. Values are integers; higher values are drawn on top of lower values.

display

How to display the element. Common values are block, inline, and none for elements that don't get laid out at all.

visibility

Whether the element is visible or hidden. Space is still allocated for non-positioned hidden elements.

overflow

What to do when element content exceeds element size. Values: visible (content overflows); hidden (excess content hidden); scroll (display permanent scrollbar); auto (scrollbars only when needed).

clip

What portion of element content to display. Syntax: rect(top right bottom left).

 

常用的一些Event

Handler

Supported by/Triggered when

onabort

<img>; image load aborted

onblur

<body> and form elements; window or element loses keyboard focus

onchange

Form elements; displayed value changes

onclick

All elements; mouse press and release; return false to cancel

ondblclick

All elements; mouse double-click

onerror

<img>; image loading fails

onfocus

<body> and form elements; window or element gets keyboard focus

onkeydown

<body> and form elements; key pressed; return false to cancel

onkeypress

<body> and form elements; key pressed and released; return false to cancel

onkeyup

<body> and form elements; key released

onload

<body>, <frameset>, <img>, <iframe>, <object>; document, image, or object completely loaded

onmousedown

All elements; mouse button pressed

onmousemove

All elements; mouse pointer moved

onmouseout

All elements; mouse moves off element

onmouseover

All elements; mouse moves over element; return true to prevent link URL display in status bar

onmouseup

All elements; mouse button released

onreset

<form>; form reset requested; return false to prevent reset

onresize

<body>, <frameset>; window size changes

onsubmit

<form>; form submission requested; return false to prevent submission

onunload

<body>, <frameset>; document unloaded

 

<input type="button" value="Press Me"

        onclick="alert('Hello World!');">

<form action="javascript:void validate( )">

 

html id内的文本内容:

<li id="DT" onclick="changeText()">您好吗? </li>

<script language="JavaScript">
function changeText()
{
DT.innerText="
我很好!";
}//function

</script>

改变文本使用属性:innerTextouterTextinnerHTMLouterHTML

 

JavaScript API Reference:

http://www.leftworld.net/online/JavaScriptP/jscriptpr2-CHP-1-SECT-1.1.html

http://www.leftworld.net/online/JavaScriptP/index.html

 

你可能感兴趣的:(Javascript编程小结(3 css property, Event...))