JavaScript Reference/Javascript Properties/accept
Версия от 18:30, 25 мая 2010; (обсуждение)
Содержание
"accept" Example
<html>
<head>
<script language="JavaScript">
function function1() {
document.all.myB.accept = "image/gif";
}
</script>
</head>
<body onLoad="function1();">
<input type="text"
name="textfield"
size="50"
accept="image/gif"
value="The content type of this field is "text/html"">
<input type="button"
id="myB"
value="The content type for this button is "image/gif"">
</body>
</html>
"accept" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<input> |
+----------------+--------------------------------------------------------------+
"accept" Possible Values
Possible Values
text/html,
image/png,
image/gif,
video/mpeg,
audio/basic,
text/tcl,
text/javascript,
text/vbscript.
"accept" Syntax and Note
Note:
Read and write property.
Set the comma-separated MIME types.
Syntax:
document.getElementById("inputID").accept = value
document.all.inputID.accept = value // IE only