1

yahoo 登録の最初のフォームを自動的に入力したかったのです。たとえば、このページの要素の検査をクリックして選択し、名の入力を変更すると

<input type="text" title="First Name" name="firstname" id="firstname" value="" size="32" maxlength="32" class="fieldValInit" autocomplete="off" aria-required="true" tabindex="1">

<input type="text" title="First Name" name="firstname" id="firstname" value="salam" size="32" maxlength="32" class="" autocomplete="off" aria-required="true" tabindex="1">

ページに変更はありません。なんで?

4

2 に答える 2

1

プレースホルダーのため、変更は表示されません。以下を使用できます。

document.getElementById('firstname').value = 'foo';

ブラウザのコンソールで、最初の名前が に変更されていることがわかりますfoo

于 2013-08-19T08:51:42.027 に答える