LoginSignup
1
0

More than 3 years have passed since last update.

chromeの検証ツールから自動で入力項目を埋める

Last updated at Posted at 2019-06-06

検証が思った以上に長引いてめんどいので作ったからメモ
jqueryを使って入力項目を埋める。
何回も新規登録でユーザを作成したりするときには便利かと。

使い方(chrome前提)は下記を自分のhtmlに合わせて修正し、検証のコンソールで実行。

入力項目
$('input[name="name"]').val('名前だぞ');
セレクトボックス
$('select[name="establish_month"]').val(2);
テキストエリア
$('textarea[name="comment"]').val('コメントだぞ');
チェックボックス
$('input[name="agree"]').prop('checked', true);
ラジオボタン
$('input[name="xxxxxx"]:eq(1)').prop('checked', true);

↑はnameを使ってますが、idを使って項目を指定する場合は
$('input[name="name"]')→$("#ID名")
になります。

その他はまたあったらここに追記していきます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0