I want to make (an HTML) \'file\' input element mandatory: something like
But it i
var imgVal = $('[type=file]').val();
Similar to Vivek's suggestion, but now you have a more generic selector of the input file and you don't rely on specific ID or class.
See this demo.