預覽:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="test.js" ></script>
</head>
ID : <input type="text" id="id" name="id" value="1" />
預覽:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="test.js" ></script>
</head>
ID : <input type="text" id="id" name="id" value="1" />
預覽:
說明:伺服器必須要做可以接收多檔案機制
<!DOCTYPE html>
<html>
<script type="text/javascript" src="test.js" ></script>
ID : <input type="text" id="id" name="id" value="1" />
var my_id = document.getElementById("my_id");
my_id.className = "new_class";
選擇圖片並顯示 (單檔案):
<p>
<label>請選擇圖片:</label>
<input type="file" id="file_input" accept="image/jpeg, image/png"/>
</p>
<div id="result"></div>
<script language="javascript">
var result = document.getElementById("result");
<html>
<body>
<video id="gum-local" autoplay></video>
</body>
</html>
<script language="JavaScript">
var video = document.querySelector('video');
var constraints = {
var s = s.replace(/\被替換的字串/g,"新字串");
例如:
var s = "AAA,BBB,CCC";
s = s.replace(/\,/g,"<br>");
輸出:
AAA<br>BBB<br>CCC