locked
what is means " document.querySelector("#scenario2Input #shuffle")."

    Question

  • http://code.msdn.microsoft.com/windowsapps/ListView-custom-data-4dcfb128/view/Discussions

    WinJS.Namespace.define("Scenario2Name", {
            initialize: function () {
                WinJS.UI.processAll();
    
                document.querySelector("#scenario2Input #shuffle").addEventListener("click", shuffleTiles, false);
                document.querySelector("#scenario2Input #removeSelected").addEventListener("click", removeSelected, false);
                document.querySelector("#scenario2Input #swapSelected").addEventListener("click", swapSelected, false);
                document.querySelector("#scenario2Input #addTile").addEventListener("click", addTile, false);
    
                initTiles();
            }
        });

    document.querySelector("#scenario2Input #shuffle").

    #scenario2Input --> where is from ?

    # --> when to use it? what means?

    Tuesday, March 27, 2012 11:18 AM

Answers

  • Hi K,

    # is a selector for the element id.  So there is an element in the html that has id="scenario2Input"

    Inside that element is another element with the id="shuffle"

    For element css classes you use something like this ".ListViewFlyout"

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, March 27, 2012 1:36 PM
    Moderator