gpt4 book ai didi

javascript - javascript html 用分号分隔用户输入

转载 作者:行者123 更新时间:2023-11-28 10:40:18 25 4
gpt4 key购买 nike

我不是 javascript html php 专家,但我想学习,我只是想征求意见是否可以使用户可以在文本框中输入单个或多个电子邮件,以 ; 分隔。使用 javascript 就像在 Outlook、yahoo、电子邮件中一样吗?

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
email <input type="text" name="FirstName" value="Mickey"><br>

</form>

</body>
</html>

最佳答案

只需输入文本并单击文本框,电子邮件就会被分隔

<html lang="en">
<head>
<title>Jquery - input tags plugin example</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>


<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-tagsinput/1.3.6/jquery.tagsinput.min.js"></script>
</head>
<body style="background: #337AB7">


<div style="width: 500px; margin: 0px auto;">
<h2 style="font-family:cursive;">Jquery - input tags plugin example</h2>
<input name="tags" id="input-tags" style="width:500px !important" />
</div>


<script type="text/javascript">
$('#input-tags').tagsInput();
</script>


</body>
</html>

关于javascript - javascript html 用分号分隔用户输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52715043/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com