Home >Web Front-end >JS Tutorial >How should jquery set the onclick event that changes the button input_Basic knowledge
How should jquery set the onclick event that changes the button input_Basic knowledge
WBOYOriginal
2016-05-16 17:46:551292browse
How should jquery set the onclick event of button input? For example, there is a button at the beginning: This Lines of code are generated in the background of the program, just like the approach in the Discuz!NT forum source code. Everything on the page, including scripts, are generated by the background code... and then loaded into the page using jquery.ajax... except for ie8. Except that it cannot be displayed... other browsers are normal. The problem now is: to dynamically change the onclick function of the previous page button. I have tried many methods, but none of them have worked. The following are listed below. An example of failure: 1. JavaScript code:
$(“#prebt”).removeAttr( "onclick"); $("#prebt").click(function(){ToPage(4)}); //This sentence will cause an infinite loop.. I don’t know what is going on.. // The paging function I made...written like this causes the data to keep jumping around. How should I solve it?
There is really no other way but to post relevant requests online. A friend asked me if the effect I want is as follows:
Actually, the effect I want is the same as above, but the above method has my original effect. It's almost the same, but it can't be executed, and it can't be bound at all. An enthusiastic netizen gave me a code example, which he said was helpful to me. The details are as follows: XML/HTML code: