Why can't I change the type of an input element to submit?

前端 未结 7 1420
盖世英雄少女心
盖世英雄少女心 2021-01-01 11:52

I\'m calling this function:

function submit_button(button_id){
    $(\'#\' + button_id).attr(\'type\', \'submit\');
}

to make this button t

7条回答
  •  既然无缘
    2021-01-01 12:04

    Here's a workaround:

    $('').insertAfter('#confirm_button');
    $('#confirm_button').remove();
    

提交回复
热议问题