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.