Questions about passing parameters in JQUERY

Source: Internet
Author: User
Hello, everyone, I want to ask a question scenario: There are two buttons on a page, and the two buttons are the information names in the database respectively, I want to click these two buttons to obtain the corresponding database information, which is displayed in the div layer below. Currently, the value of this button can be assigned to jquery. The operation is as follows: corresponding tag information & nbsp; & n about JQUERY parameter passing
Hello, everyone. I want to ask a question.
Scenario: There are two buttons on a page. the two buttons are the information names in the database respectively. I want to click these two buttons, the corresponding database information can be obtained and displayed in the div layer below. Currently, the button value can be sent to jquery as follows:
Corresponding tag information
For (loop) {echo "";
Echo" ";
Echo "$ type_category_id '> $ type_category_name ";
Echo" ";
Echo "";}
Red indicates the value corresponding to each label.
Jquery code:
$(function(){
    $('.dapei_partmiddle').each(function(){
    $(this).click(function(){
    $(this).html($(this).attr('name'))
        })
    })

Now I want to know how to click a tag to call out the name of a tag and put it in the select statement of the database.
The above solutions, online and so on. Thank you for sharing:
------ Solution --------------------
Ideas:
Click the button to trigger the js event, get the value of the button, and then pass it to the server through ajax. based on the parameters of the transferred button, the corresponding query results are returned (encapsulated into a string, remember to arrange the returned characters in the layout) to the front-end.
Once you switch the button, you can return the query result to the front-end. the specific code implementation depends on your skills.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.