开发者

How to use jQuery Mobile selector menus?

I've finally found the HTML for the jQuery Mobile selector menu component, thanks to my other question, but I'm stuck again.

I'm currently using this code, which works nicely:

<div data-role="content">   
    <div data-role="fieldcontain"> 
        <label for="select-choice-nc" class="select">Font Choice:</label> 
        <select name="select-choice-4" id="select-choice-nc"> 

            <option value="arial">Arial</option> 
            <option value="papyrus">Papyrus</option> 
            <option value="helvetica">Helvetica</opti开发者_C百科on> 
            <option value="calibri">Calibri</option> 

        </select> 
    </div> 
</div><!-- /content -->

But how do I tell which option has been selected?


It's just like jQuery sans Mobile (perhaps jQuery Immobile?). As with other form elements, use .val() to get the value of the <select>:

$('#select-choice-nc').val();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜