How to change lowercase chars to uppercase using the 'keyup' event?

后端 未结 12 1828
失恋的感觉
失恋的感觉 2021-01-31 01:58

My goal is to use the jQuery event .keyup() to convert inputted lowercase chars to uppercase.

How can I achieve this?

12条回答
  •  一向
    一向 (楼主)
    2021-01-31 02:32

    Make sure that the field has this attribute in its html.

    ClientIDMode="Static"

    and then use this in your script:

    $("#NameOfYourTextBox").change(function () {
                     $(this).val($(this).val().toUpperCase());
                 });

提交回复
热议问题