is there any way that html element file
only accept PDF files and when we
Not really. See File input 'accept' attribute - is it useful? .