简体   繁体   中英

Javascript - URL based on Drop Down Selections - If all dropdowns variables are blank, then goto a specific URL

This is my code so far: http://jsfiddle.net/zY3xx/

I have a blank option in all 3 dropdowns, and I want to modify the existing Javascript so that it goes to a specific URL if all 3 dropdowns have the blank option selected. The Variable is literally left empty, so it should be something along the lines of:

if newURL = "" then goto "http://mycustomurl.com"

I'm just not sure how to implement that option in Javascript.

Does anyone know how?

Try this :

    if (newUrl.length === 0) {
        newUrl = 'http://google.com';
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM