1

So what I am looking for is to show some sort of text like "none" when there isn't an input check box inside of the drop down. I am using Node.js.

Unlike How do I make a placeholder for a 'select' box?, in this case there can be an option where nothing appears inside of the drop-down. So using an option with "" value as a placeholder won't work.

Here is my jQuery code:

$(".dropdown dt a").on('click', function() {
    $(".dropdown dd ul").slideToggle('fast');
});

$(".dropdown dd ul li a").on('click', function() {
    $(".dropdown dd ul").hide();
});

function getSelectedValue(id) {
    return $("#" + id).find("dt a span.value").html();
}

HTML:

<dl class="dropdown"> 
    <dt>
        <a href="#">
            <span class="hida">Select this dropdown</span>    
            <p class="multiSel"></p>  
        </a>
    </dt>
    <dd>
        <div class="multiSelect">
            <ul>
                {{{Something}}}
            </ul>
        </div>
    </dd>
</dl>

This jQuery seems like it might go in there:

if (".dropdown dd ul" = ""){
    return $("None");
}

But I know it doesn't work. How can I show "none" when the multi select is empty?

Community
  • 1
  • 1
userlkjsflkdsvm
  • 961
  • 1
  • 21
  • 53

0 Answers0