Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
- <script type="text/javascript">
- function imageURL(input) {
- if (input.files && input.files[0]) {
- var reader = new FileReader();
- reader.onload = function(e) {
- $('#preview_img').attr('src', e.target.result)
- .width('100px')
- .height('100px');
- }
- reader.readAsDataURL(input.files[0]);
- }
- }
- </script>
- </head>
- <body>
- <input type="file" class="file" onchange="imageURL(this)" />
- <input type="file" class="file" onchange="imageURL(this)" />
- <input type="file" class="file" onchange="imageURL(this)" />
- <img id="preview_img" style="width:250px; height:250px;" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement