一千萬個為什麽

搜索

原型選擇器相當於jQuery

如何選擇彈出式燈箱 div的彈出窗口

在jQuery中,它就像$('div#popup-lightbox #popupwindow')。不幸的是,在Prototype中,它並不那麽容易......任何人都可以幫助我嗎?謝謝!

<div id="popup-lightbox" class="popup">
    <div id="popupoverlay"></div>
    <div id="popupdiv">
        <div id="popupwindow"></div>
    </div>
</div>

<div id="popup-modal" class="popup">
    <div id="popupoverlay"></div>
    <div id="modaldiv">
        <div id="popupwindow">
            <div id="modalint">Your changes have not been saved.</div>
        </div>
    </div>
</div>

最佳答案

Use the bling-bling http://api.prototypejs.org/language/dollardollar/

$$('#popup_lightbox #popup_window') (also, you are not using ids properly, like desau and fantactuka said)

轉載註明原文: 原型選擇器相當於jQuery