Select file upload input

Description

The following code shows how to select file upload input.

Example


<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){<!--  ww w .  jav a 2 s  .c o  m-->
    alert($(":file").length);

});
</script>
</head>
<body>
    <input type="button" value="Input Button"/>
    
    <input type="checkbox">java2s.com</input>
    <input type="checkbox" />
    <input type="checkbox" />
    <input type="file" />
    <input type="hidden" />
    <input type="image" />
    <input type="password" />
    <input type="radio" />
    <input type="reset" />
    <input type="submit" />
    <input type="text" />
    
    <select><option>Option<option/></select>
    <textarea></textarea>
    <button>Button</button>
</body>
</html>

Click to view the demo





















Home »
  jQuery »
    jQuery Example »




Animation
DOM
Event
Form
List
Select
Style
Table
Utilities