JS Basic x1

Source: Internet
Author: User

The status of JS windows can control the State Bar information (the effect is not visible on IE9)
var space_num=0;
var dir=1;
function Myscroll () {
var space_my= "";
Space_num=space_num+1*dir;
if (space_num>50 | | space_num<0) {
Dir=dir*-1

}
for (Var i=0;i<space_num;i++) {
space_my+= ""
}
window.status=space_my+ ' Hello World '
}
function Startit () {
SetInterval (' Myscroll () ', 100)
}
</script>
<body onload= "Startit ()" >

History.
Location.
Navigator.
Screen.
Event

1. Bind directly to an HTML control such as <input onlocick= ' function () ' >
2. After getting the element through getElementById (), Start again
<script>
function Function1 () {
}
getElementById (' xx '). Onlick=function1
</script>
<table id= ' xx ' ...>
Unbind events
getElementById (' xx '). DetachEvent (' onclick ', function)

getElementById (ID): Details if many of the same IDs (such as id= ' CC ') are present, the first one will be taken

The principle of ID do not start with a number

Getelementsbyname () returns the collection of objects through the HTML control name

The ID can be not unique, but name can be unique

getElementsByTagName () returns a collection of objects via HTML tags

Createelenment () Creates an element that specifies a label name (such as dynamic)

JS Basic x1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.