Jump to content

Search the Community

Showing results for tags 'html javascript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. Hello I am new to HTML and javascript. I would like to get the number of files of an directory as an var in javascript. For example: If I have an folder called "C:\Users\media" and I know there are only 10 images in that folder I want the code so that I can have a variable representing the number 10(also this is subject to change like I can add images and then there will be let's say 11 images in the folder and if the pages reload the variable must contain the number 11). The closest I have come to a solution is this: <input type="file" id="file" multiple /> . However I don't want to select the files I want the files(number of files more specifically) to be automatically updated to a variable instead of select an file and then writing JS to get the length. The only solution I want must be in HTML,javascript,CSS. If you want to provide a solution using something else(lets say PHP or something I don't know...) please don't. Thank you so much PS. I apologize if this topic is in the wrong section on the forums,I want a JS solution so I posted here Also like I said I am pretty new(learning my self) so if you provide a kind of complex solutions then please just comment in why you used whatever you used.
  2. Iven

    Alert not working

    Hello I am trying to use an <input ..... /> tag and javascript to get user input and then alert() the user input. However doesn't matter what I do I either get either nothing,"undefined" or "null"? Here is an example of what exactly I am trying to do( if you run this in w3Schools TryIt editor then the alert box will show nothing) : <!DOCTYPE html> <html> <body> <p>Click the button to demonstrate line-breaks in an alert box.</p> <input type=text" id="txt" placeholder="Enter" /> <button onclick="myFunction()">Try it</button> <script> var x = document.getElementById("txt").value; function myFunction() { alert(x); } </script> </body> </html> Any help will be appreciated . I would also like to know why this is reacting like this as I fount solutions exactly like this on the internet but it seems not work at all.
×