這是一個smiple html表單,我想從它獲取數據並轉換爲xml或以xml格式獲取數據?如何使用JavaScript或jQuery將HTML表單數據保存爲xml格式?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form action="" method="post">
<p>
<label for="firstname">First Name:</label>
<input type="text" name="firstname" id="firstname">
<label for="lastName">Last Name:</label>
<input type="text" name="lastname" id="lastname">
<button id="submitButton">submit</button>
</body>
</form>
</html>
可能的複製到一個XML文件使用Javascript?](https://stackoverflow.com/questions/11383236/how-to-output-html-form-data-to-a-xml-file-using-javascript) – JRoss