JavaScript methods for manipulating element properties

Source: Internet
Author: User

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><title>Document</title><style></style><Scripttype= "Text/javascript">window.onload= function() {OText1=document.getElementById ('Text1'); varname= 'value'; //alert (Otext1[name]);        //alert (otext1[' _name_ ');        /*element. GetAttribute (property name) method gets the value of the specified attribute of the specified element custom property is obtained with GetAttribute*/        //Alert (Otext1.getattribute (' value '));                /*element. SetAttribute (property name); method sets the value for the specified element*/        //otext1.setattribute (' value ', ' yes ');                /*element. RemoveAttribute (property name); method removes the specified attribute from the specified element do not delete the element with RemoveAttribute property*/        //otext1.removeattribute (' value ');                /*1. Use "."        and "[]" form cannot manipulate the custom attribute of the element getattribute can manipulate the custom attribute of the element 2. You can get the actual value of the element property IE7 or return the absolute path of the resource */        //alert (otext1._name_);        //alert (otext1[' _name_ ');        //otext1.removeattribute (' _name_ ');    }    </Script></Head><BodyID= "Body">    <inputtype= "text"ID= "Text1"value= "ABC"_name_= "M Taste" /></Body></HTML>

JavaScript methods for manipulating element properties

Related Article

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.