Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7918677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:35:32+00:00 2026-06-03T15:35:32+00:00

In an html page ,I am adding an input element. <input type=file name=fileselect id=fselect>

  • 0

In an html page ,I am adding an input element.

<input type="file" name="fileselect" id="fselect"> </input>

I wanted to execute a javascript function ,when a user selects a file.Suppose I want to write to the console too.

Is jquery select() the correct function to check if user has selected a file? I tried like this

$(document).ready(function(){
   $('#fselect').select(function(){ 
      console.log('selected');
      myfun(); 
    });
});

function myfun(){
   alert('you selected a file');
}

For some reason, when I select a file using the input element,nothing is written to console and no alert box appears..Is the select() call coded wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:35:33+00:00Added an answer on June 3, 2026 at 3:35 pm

    The event you want is change, not select.

    From the docs:

    The select event is sent to an element when the user makes a text selection inside it.

    And for change:

    The change event is sent to an element when its value changes

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When adding user input to a web page, it should (unless it's HTML of
I am adding HTML input controls on the page dynamically via a add text
I have following textbox in my first HTML page: <input tabindex=4 type=text class=search_textbox roundedCorners
I have a HTML page, with html-mode enabled. I call function sgml-validate to check
Here's my code: <!doctype html> <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js></script> <style type=text/css> label {display:block;
below is my html page, which contains a button . in my button input.ui-button
In html page some tags are dynamically created using jquery and contents are loaded
I had created one HTML page for my experiance. In this i had use
Given an HTML page I would like to get all the 'x' files that
My index.html page for my project needs some Ruby code so I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.