Search:

Type: Posts; User: Rain Lover; Keyword(s):

Page 1 of 9 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    336

    Attribute Default Value

    Can you get an attribute default value so you don't have to repeat it in the following example:


    <p title="foo" id="p">Hello, world!</p>
    <input type="text" id="i">
    <script>
    var p =...
  2. Replies
    1
    Views
    517

    padding:initial vs. padding:0

    Does padding:initial have any advantage over padding:0? Example:


    <style>
    textarea {
    padding: 0;
    }
    </style>
    <textarea>Hello, world!</textarea>
  3. Replies
    1
    Views
    325

    Comparison with 0 and JSLint error

    Here's the code:


    <input type="number" value="0" id="input">
    <script>
    if (document.getElementById('input').value == 0) {
    alert('Hello, world!');
    }
    </script>
  4. HTML Pencil: an online HTML editor with real-time preview

    HTML Pencil is an online HTML editor created for modern browsers.

    Please review the source code and provide feedback:


    <!DOCTYPE html>
    <html lang="en">

    <head>
    <meta charset="UTF-8">
  5. Replies
    2
    Views
    388

    Target=“_blank” vs window.open

    I'm working on an application where users enter some input and they shouldn't leave the page when clicking on share links, e.g. a Facebook share link:

    <a...
  6. Replies
    2
    Views
    558

    Thanks for the explanation! I finally decided to...

    Thanks for the explanation! I finally decided to use two separate functions.
  7. Replies
    2
    Views
    558

    One element, multiple events

    In jQuery you can easily do it like this:


    $("#foo").focus(function () {
    // Do this.
    }).blur(function () {
    // Do that.
    });

    Can we do something similar in JavaScript so we don't...
  8. Replies
    4
    Views
    871

    Yes, it seems to be working with no problem....

    Yes, it seems to be working with no problem.
    Thanks, anyway!
  9. Replies
    4
    Views
    871

    Thanks to HTML5 File API...

    Thanks to HTML5 File API now we can even read a file content with JavaScript: demo.




    Sorry if the question isn't very clear!
    I mean you cannot re-select the same file twice in a row, i.e....
  10. Replies
    4
    Views
    871

    Upload the same file

    You cannot select and upload the same file except in Firefox, which mistakenly allows you to do so:


    <input type="file" id="fileChooser">
    document.getElementById('fileChooser').onchange =...
  11. Replies
    7
    Views
    1,328

    My poor English! Sorry, I should have used the...

    My poor English! Sorry, I should have used the verb confirm. :)
  12. Replies
    7
    Views
    1,328

    Thanks for admitting my code!

    Thanks for admitting my code!
  13. Replies
    7
    Views
    1,328

    It refers to my previous thread...

    It refers to my previous thread. Since it has a different question I thought I'd better keep them separate and open a new thread. As you see in the demo it's a text editor based on whose content the...
  14. Perfect answer! Thanks! :)

    Perfect answer! Thanks! :)
  15. Replies
    7
    Views
    1,328

    Minimum events to call on a dynamic link

    Sample:


    <!DOCTYPE html>
    <html>

    <head>
    <meta charset="UTF-8">
    <title>Dynamic Link</title>
    </head>
  16. Thanks for the test, but please give it a try in...

    Thanks for the test, but please give it a try in IE11.
  17. The problem doesn't seem to be due to the...

    The problem doesn't seem to be due to the download attribute. Here's a demo without it:
    Demo.
  18. Open links made by createObjectURL in IE11

    Why can't you open the link in the following demo:
    http://html5-demos.appspot.com/static/a.download.html

    You cannot even right click and open it in a new tab/window. Is there any setting in the...
  19. Thanks again for the detailed answers and...

    Thanks again for the detailed answers and snippets! You've been always of great help! :)
  20. Thanks very much! Is it OK to simplify it like...

    Thanks very much! Is it OK to simplify it like this:


    <!DOCTYPE html>
    <html>

    <head>
    <meta charset="UTF-8">
    <title>Cross Origin Security Error 3</title>
    </head>
  21. But it shouldn't throw such an error as I change...

    But it shouldn't throw such an error as I change the iframe source in my function.
    I just learned I can partially resolve the issue if I wait until the iframe finishes loading: Demo. However, it...
  22. Cross origin security error although the iframe is on the same domain

    I get a security error in console when I click the button:


    var iframe = document.getElementById('iframe'),
    button = document.getElementById('button');
    ...
  23. Replies
    1
    Views
    467

    File API: reader vs. event.target

    I have studied many articles and posts to learn about File API and still don't understand why almost all of them use event.target instead of reader. Here are three examples:


    File API
    ...
  24. Replies
    2
    Views
    601

    Thanks for the answer! I never thought it could...

    Thanks for the answer! I never thought it could be so simple.
    onchange is added to support IE and oninput for other browsers to handle <input type="range">. Does the events order make any difference?
  25. Replies
    2
    Views
    601

    Multiple events one function

    The following works with no problem:


    element.oninput = go;
    element.onchange = go;
    ...

    But isn't there a shorter way to achieve the same result? Do we have to repeat the same line for each...
Results 1 to 25 of 214
Page 1 of 9 1 2 3 4