1. If a problem occurs in the project, the click of the button cannot be triggered. If you click the button, the breakpoint does not go to the click. That is, if the click method is not triggered, You need to bind the event.
$ (". Successnum"). Each (function (I ){
$ (This). BIND ("click", sub );
});
Code explanation:
Traverse all the elements whose class names are. successnum and add events to them one by one. Sub is the method called when the click is triggered.
2. Div is a block element that automatically occupies a row when displayed. display: block ;. Div has no value attribute, but if you need Div to access the value, you can set the title of the DIV and obtain the title attribute value of the div.
For example, in an Ajax request:
For (VAR I = 0; I <data. length; I ++) {// ID of the data stored by the title Attribute Value
$ ("# Selectable"). append ("<li class = 'ui-state-default'>" +
"<Div class = 'adaptername' Title = '" + data [I]. adapter_id + "'>" + data [I]. adapter_name + "</div>" +
"<Div class = 'successnum' Title = '1'> success count:" + data [I]. ssize + "</div>" +
"<Div class = 'errornum' Title = '0'> failure count:" + data [I]. fsize + "</div> </LI> ");
}
// Add a binding event.
$ (". Successnum,. errornum"). BIND ("click", sub );
3. Obtain the title attribute accessed in the div.
Function Sub (){
VaR titlevalue = $ (this). SRC ("title ");
}
4. The real cause of the error.
Reference the plug-in jqueryui, selectedtable, which disables the mouse click event. The plug-in does not have much effect, so just remove it.