Get Text of checkbox with Jquery

后端 未结 5 646
故里飘歌
故里飘歌 2020-12-06 10:24
Pre-Payment

How would I get the text \"Pre-Payment\" from this using Jquery?

5条回答
  •  渐次进展
    2020-12-06 10:59

    I had a similar problem to this - another way you could make this work (with HTML5) is to use data attributes.

    As an example, you'd set a data attribute as follows:

    Pre-Payment

    You could then read this data attribute by using the following jQuery:

    $(input).data('text');
    

    The benefit of doing it this way is that you can have a seperate value parameter if required.

提交回复
热议问题