LoginSignup
1
0

More than 5 years have passed since last update.

【WordPress】プラグイン「Contact Form 7」で出力されるform要素に対してJSで属性を追加する(autocomplete="off"を付与させる)

Last updated at Posted at 2019-03-20

プラグイン「Contact Form 7」のformタグに属性を追加する

ショートコードいじってもできなさそうなんでもうJSで無理やり属性を付与させます

例としてautocomplete="off"を追加します

<script type="text/javascript">
$(window).load(function(){
    $('form.wpcf7-form').attr('autocomplete', 'off');
});
</script>

他の属性もこんな感じで追加していけば行けるはず

おわり

  • しれっとjQueryで書いてる(てへぺろ
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