Js:
document.getElementById ("Input object ID"). AddEventListener (' input ', function () {
Console.log ("AAAAA");
});
JQ:
$ ("input object"). Bind ("Input PropertyChange", function () {
Console.log ("AAAAA");
});
Click monitoring of the MUI Clear button:
MUI (' input object ') [0].addeventlistener (' Focus ', function () {
MUI (". Mui-icon-clear") [0].addeventlistener (' Tap ', function () {
Console.log ("AAAAA");
});
})
Note: Because the Clear button in the MUI search box appears when the input box focus, that is, input gets the focus, if the focus listener event is not input, then the click event of the Clear button will not be heard.
I think it is because the clear button, the following span is the document after loading, the MUI JS loaded into the, so when the input focus event is not first listened to, the Purge button listener event is not found that DOM object, so will be reported such errors.
JS,JQ Monitor the change of input value in time, click-Listen event of clear button in the input search box of MUI