Reputation: 1227
I am trying to manually submit a form in Chrome's developer console by running code like:
$('form').submit();
How can I specify the input value of the form in this code? I know the input id/name.
Upvotes: 2
Views: 20431
Reputation: 491
document.querySelector() can be replaced by $()
$('input[name="theNameOfYourInput"]').value = 'theValue';
$('form').submit();
Upvotes: 0
Reputation:
document.querySelector('input[name="theNameOfYourInput"]').value = 'theValue';
document.querySelector('form').submit();
Chrome console knows nothing of jQuery. Use vanilla JS.
Upvotes: 9