JQuery - Duplicate Field Input Text In Real Time

前端 未结 5 2099
盖世英雄少女心
盖世英雄少女心 2020-12-23 23:39

I\'m trying to figure out how to copy a users text input in one form field to another. Specifically, when someone fills in their email address in the contact form, it will b

5条回答
  •  猫巷女王i
    2020-12-24 00:13

    Is $("#mail") another input box ? It doesn't appear in your HTML (Edit: well it does now, but didn't at first :)

    $("#mail").val($("#email").val()) should do what you want.

提交回复
热议问题