18910140161

JavaScript-在html中添加一个表单-堆栈溢出

顺晟科技

2022-10-19 13:53:36

185

这是我的代码。当我单击+按钮时,我想再添加一种药物,如何完成此任务?

<html>
<body style="color:black; font-size:20px;">
<form>
    <label style="margin-right:95px;"> Medicine </label> 
    <label style="margin-right:135px;"> Qty. </label>
    <label> Timing-Freq-Duration </label> <br>
    <input type="text" id="medicine" name="medicine" placeholder="Medicine Name">
    <input type="text" id="quantity" name="quantity">
    <input type="text" id="duration" name="duration">
    <input type="submit" style="margin-left:30px;" value="+">
</form>
</body>
</html>  


顺晟科技:

不确定除了你提到的以外你能/不能做什么,但我可能会做这样的事情。

您需要使用JavaScript。 这是一个使用jQuery库和Bootstrap的简单示例(主要是为了获得样式)。 https://getbootstrap.com/docs/5.1/get-start/integrate/ https://jquery.com/

查看下面的演示:

  • TAG:
相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航