Use
document.getElementById("file-id").files[0].name;
instead of
document.getElementById('file-id').value
Related Posts:
- jQuery document.createElement equivalent?
- How can I scroll to an element using jQuery?
- Include another HTML file in a HTML file
- JavaScript get element by name
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- How can I select an element by name with jQuery?
- Parse an HTML string with JS
- Retrieve the position (X,Y) of an HTML element
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Maximum call stack size exceeded error
- How to properly use jsPDF library
- Can I use complex HTML with Twitter Bootstrap’s Tooltip?
- Google Chrome Uncaught (in promise) DOMException while playing AUDIO
- How to make a word underline in Markdown
- ChartJS beginAtZero, min, max doesn’t work
- How do I check whether a checkbox is checked in jQuery?
- how to fix : ” TypeError: Cannot read property ‘addEventListener’ of null”…?//
- Cannot set property InnerHTML of null [duplicate]
- ReferenceError: $ is not defined
- How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
- React.js: Set innerHTML vs dangerouslySetInnerHTML
- How do I check whether a checkbox is checked in jQuery?
- (Google Map API) Geocode was not successful for the following reason: REQUEST_DENIED
- How to make a word underline in Markdown
- Pure JavaScript equivalent of jQuery’s $.ready() – how to call a function when the page/DOM is ready for it [duplicate]
- How to play audio?
- How to play audio?
- jQuery.click() vs onClick
- jQuery Get Selected Option From Dropdown
- Remove element by id
- Check if checkbox is checked with jQuery
- How to make JavaScript execute after page load?
- Add swipe left/right to web page, but use default swipe up/down
- How to add jQuery code into HTML Page
- How can I get the data-id attribute?
- Check if checkbox is checked with jQuery
- How to make JavaScript execute after page load?
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- JavaScript: Upload file
- Angular: mat-form-field must contain a MatFormFieldControl
- (change) vs (ngModelChange) in angular
- Bootstrap Dropdown menu is not working
- jquery SlideToggle effect in upward direction?
- Change Background color (css property) using Jquery
- Remove all child elements of a DOM node in JavaScript
- Failed to load resource: net::ERR_FILE_NOT_FOUND loading json.js
- Get class name using jQuery
- How to clear the canvas for redrawing
- Javascript: getElementById vs getElementsById (both works on different pages)
- Adding options to select with javascript
- Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser
- Set timeout for ajax (jQuery)
- querySelector vs. getElementById
- How does the data-toggle attribute work? (What’s its API?)
- CSS height 100% percent not working
- jQuery Ajax File Upload
- Use images like checkboxes
- How to read xml file contents in jQuery and display in html elements?
- HTML5 Local storage vs. Session storage
- Completely disable scrolling of webpage
- TypeError: Cannot Set property ‘onclick’ of null
- Express Render not working return error: No default engine was specified and no extension was provided
- How do I scroll to an element using JavaScript?
- Jquery swipe left or right on mobile
- Programmatically change the src of an img tag
- display variable image using cookies
- Find an element in DOM based on an attribute value
- How to move an element into another element?
- React Error: Target Container is not a DOM Element
- character counter – backspace doesn’t reflect on characters remaining
- scrollIntoView Scrolls just too far
- Open URL in same window and in same tab
- Create table with jQuery – append
- Error: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’
- Difference between innerText, innerHTML and value?
- How do I set/unset a cookie with jQuery?
- How to convert selected HTML to Json?
- How would I call a javascript function in html?
- How to Open New window on every Click
- Encode HTML entities in JavaScript
- How to make JavaScript execute after page load?
- “.addEventListener is not a function” why does this error occur?
- How can I check if an element exists in the visible DOM?
- How to move all HTML element children to another parent using JavaScript?
- Cannot read property ‘getContext’ of null, using canvas
- Full-screen iframe with a height of 100%
- Coin toss with JavaScript and HTML
- How to print HTML content on click of a button, but not the page?
- jQuery disable/enable submit button
- Play an audio file using jQuery when a button is clicked
- How can I add a class to a DOM element in JavaScript?
- How to move an element after another element using JS or jquery?
- Check if an element contains a class in JavaScript?
- Bootstrap 4 Dropdown Menu not working?
- How to use Javascript to read local text file and read line by line?
- Why is the jquery script not working?
- Shortest way to print current year in a website
- getBoundingClientRect is not a function