Latest web development tutorials

HTML DOM FileUpload name attribute

Fileupload Object Reference Fileupload objects

Definition and Usage

name property sets or returns the name attribute value of the FileUpload object.

name attribute is used after the form is submitted to the server to transmit data or form data referenced in Javascript.

Note: After the form is submitted only name attribute of the form element will pass data values.

grammar

Setting name attribute:

fileuploadObject.name="name"

Returns the name attribute:

fileuploadObject.name


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute name


Examples

Examples

Display name attribute value input element:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
var x = document.getElementById ( "fname") name.;
alert (x);
}
</ Script>
</ Head>
<Body>

<Form>
Select a file to upload:
<Input type = "file" name = "filename" id = "fname" size = "50" />
</ Form>
<Button type = "button" onclick = "displayResult ()"> Display Name </ button>

</ Body>
</ Html>

try it"


Fileupload Object Reference Fileupload objects