使用 HTML 和 jQuery 建立表單


要使用 HTML 建立表單,我們使用以下內容 −

<form action = "" method = "get">
   Details:<br><br>
   Student Name<br><input type="name" name="sname"><br>
   Exam Date and Time<br><input type="datetime-local" name="datetime"><br>
   <input type="submit" value="Submit">

要使用 jQuery 和 HTML 建立表單,請新增 輸入型別 文字,如下 −

$form.append('<input type="button" value="button">');

更好的示例如下 −

$myform = $("<form></form>");
$myform.append('<input type="button" value="button">');
$('body').append($myform);

更新時間:2023-11-12

1 千次以上瀏覽

開啟你的 職業生涯

完成課程認證

開始操作
廣告
© . All rights reserved.