Internet Explorer issue with HTML5 form attribute for button element

前端 未结 6 1531
不知归路
不知归路 2020-12-29 09:18

in HTML5, there is the form attribute. Basically

6条回答
  •  一生所求
    2020-12-29 09:45

    From @Voldemaras Birškys' answer, I've improved his script to work as a polyfill so you can still have the form attribute no your button and it will work as if EDGE/IE would respect the form attribute.

    
       
    
    
    
    
    

    The main difference is that now we include form on the external submit button. Also, inside the click handler I just use the event to get the target element and from id discover the id of the target form.

    :)

提交回复
热议问题