How to populate React-generated input fields with JQuery

前端 未结 2 497
离开以前
离开以前 2021-01-27 03:23

I\'m trying to write a bookmarklet to autofill a form, to simplify manual testing. The site is implemented in React. I\'ve tried using JQuery, for example:

$(\"#         


        
2条回答
  •  时光说笑
    2021-01-27 03:44

    From our discussion in the comments, my guess is that you'll want to fire a change event for each input you plan on modifying.

    var element = document.getElementById('emailAddress'),
        event = {
            target: {
                value: 'new value for the input'
            }
        };
    element.onchange(event);
    

提交回复
热议问题