Home  >  Q&A  >  body text

javascript - How to use checkbox to filter out values ​​that meet conditions? ?

I have several checkboxes in the front desk, and when I want to click on the first checkbox, I compare it with a parameter in the data passed from the background. If it matches the first checkbox, I will display it. . . Please tell me, how to implement this function

The parameters in the data requested by ajax include flight, and the checkbox option is China Eastern Airlines. If you want to select China Eastern Airlines, display the data starting with CES in the flight on the page. . . Please tell me how to achieve it, gods. Can you teach me?

学习ing学习ing2689 days ago874

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-06-08 11:04:31

    Use regular /^ESC/ to judge each one, and then use show hide to process it. Or indexOf()==0 is the beginning.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-06-08 11:04:31

    Determine whether it is selected: $("input[type='checkbox']").is(":checked"),
    If it is selected and consistent with the parameters, just perform the corresponding display.

    reply
    0
  • 怪我咯

    怪我咯2017-06-08 11:04:31

    Can be judged by $("input:checkbox:checked")

    reply
    0
  • Cancelreply