On the problem of jquery passing parameters
Hello, little brother, I want to ask a question.
Scene: A page has 2 buttons, two button names are the information name of the database, I hope that by clicking on the two buttons, you can get the corresponding database information in the DIV layer below, it is now possible to give the value of the button to jquery, the operation is as follows:
The corresponding label information
for (loop) { echo "";
echo "";
echo "$type _category_name";
echo "";
echo "";}
The red label is the value that corresponds to the entire label.
jquery Code:
$ (function () {
$ ('. Dapei_partmiddle '). each (function () {
$ (this). Click (function () {
$ (this). HTML ($ (this). attr (' name '))
})
})
Now I want to know how I can click on a tag to call the name of a tag and put it in the database SELECT statement
Above solve,, online and so on. Thank you
Share to:
------Solution--------------------
Ideas:
By clicking the button to trigger the JS event, get the value of the button, and then pass Ajax to the server, according to the parameters of the Transfer button, return the corresponding query results (encapsulated into a string, remember to put the returned character layout) to the front end.
Switch One button, return the query to the results of the string returned to the front, the specific code to achieve, depends on your skills.