Js Section 1-js attribute operations

Source: Internet
Author: User

Js Section 1-js attribute operations
Js Section 1-js attribute operations today we will talk about js attribute operations in Section 1. What are attributes? An attribute is a description of a thing, such as its id and value of an element. Each element has its own attributes and the attributes we define for it-Custom Attributes. In short, these attributes describe the unique characteristics of its elements. Now, I will explain to you what js attribute operations are through two instances. I. The first example is: Image carousel:
Figure 1: Loading

Figure 2: HTML code and CSS code after loading:




JS Code:



Var oId = document. getElementById ("attribute id');, which is used to obtain an element with an id. index = 0; this is an attribute not available to the element itself-it is called a custom attribute. A custom attribute is generally used as an array with many index values.
II. The second instance is: Message sending
:

Figure 3: HTML and CSS code for message sending:

JS Code:
Startup club '; this is the write operation. In the next section, we will talk about the application of the for Loop in js.

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.