Jump to content

shree420

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by shree420

  1. Yes variables in a page are accessed by JavaScript code on that page only. To access variable values in different pages you can use:

    1. Cookies

    2. Local storage of browser.

    3. Pass variables values in query string (like url?var1=2&var2=myvarvalue)

     

  2. When you are putting return inside the jQuery Each method then this is not letting the loop to run for every item. Simply remove this line. The final jQuery each code will be:

     

    $(function () {
        $('#selectliste').change(function () {
            var l = selectliste.options[selectliste.selectedIndex].innerHTML;
            var tous = l.split(' ');
            $.each(tous, function(index, value) {
                $("#label").html(value) + "<br>";
                //return ( value !== "" );
            });
        })
    });

     

×
×
  • Create New...