Easyui assigns a value to the text box checkbox,

Source: Internet
Author: User

Easyui assigns a value to the text box checkbox,

I just got into the company to create a background Maintenance System, selecting easyui has never been used. I encountered some problems when assigning values to the text box on the page. I have used several methods before and have not been able to assign values to the input text box successfully. First, try the traditional JavaScript code: document. getElementById ("itemvalue "). value = "value"; second, some methods in jquery fail to take effect. $ ("# itemvalue "). val ('value'); // pass val $ ("# itemvalue "). text ('value'); // use text $ ("# itemvalue" ).html ('value'); // use html $ ("# itemvalue "). attr ('value', 'value '); // Through the attribute // I still cannot find it here. I finally got some results by checking the information on the Internet. So far, I feel a little cool. I still learned this through the Internet. what's going on! <Input type = "text" name = "itemvalue" id = "itemvalue" class = "easyui-textbox"> when we use a style like easyui-xxxx class: our set value method should be like this: $ ('# itemkey '). textbox ('setvalue', 'value'); the value should be like this $ ('# itemkey '). textbox ('getvalue'); uses the traditional $ ("# itemkey "). val (); there are other settings, such as the <input type = "text" name = "itemvalue" id = "itemvalue" class = "easyui-datebox"> then the method set by him should be like this $ ("# xxx "). datebox ('setvalue', '2017-15-12 '); Of course, when we see datebox, we should understand that it is a date style. The value is not mentioned. <input type = "text" name = "itemvalue" id = "itemvalue" class = "easyui-numberspinner"> for example, you can see that the value is the same as the value above $ ("# xxx "). numberspinner ('setvalue', 'value') as shown above, the result setting value is generally based on the text box. Use easyui-xxxxx to remove the previous xxxx after easyui-as the method for setting the value () checkbox Value Method: $ ('# constant_type_type '). combobox ('getvalue') is probably in this way

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.