w3cschools Javascript Examples: A Quick Reminder

Just read the examples there a day ago. I list this as a reminder. Anyway, please be notified that it’s not comprehensive.

document
document.getElementById(“idname”)
document.getElementsByName(“idname”)
document.forms.length
document.images.length
.write()
.title
.URL
.referrer
.domain
.anchors.length

image
.height
.width
.src

form
.action
.method
.reset()
.submit()
onsubmit=”return checkinput()”
document.forms[0].coffee >> ได้ array

checkbox
.checked = false
onclick=”if (this.checked) {convertToUcase()}

textbox
.select()
.tabIndex

dropbox
<select onchange=”xxx()”>
<option></option>
</select>
mylist.options[mylist.selectedIndex].text
.size = x
.multiple = true
.remove(index)

table
.border
.cellPadding
.cellSpacing
.rows[0] (there’s no cols)
.rows[0].cells >> array of cell
.frame = “above”
.frame = “below”
.rules = “rows”/”cols”
.createCaption().innerHTML = “xxx”
.deleteRow(i) (td.parentNode.parentNode.rowIndex)
#insert new row
var x=document.getElementById(‘myTable’).insertRow(0);
var y=x.insertCell(0);
var z=x.insertCell(1);
y.innerHTML=”NEW CELL1″;
z.innerHTML=”NEW CELL2″;

event
onmousedown=”xxx(event)”
event.button == 2 << right click
event.clientX , clientY
event.keyCode
event.screenX, screenY
event.shiftKey==1
event.target
event.type
onclick=”xxx(this)”

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: