当前位置: 代码迷 >> JavaScript >> 怎么将子(child) dropdownlist中取的值,赋给下一级 (parent)dropdownlist
  详细解决方案

怎么将子(child) dropdownlist中取的值,赋给下一级 (parent)dropdownlist

热度:467   发布时间:2013-03-10 09:38:39.0
求教:如何将子(child) dropdownlist中取的值,赋给上一级 (parent)dropdownlist

在web 客户端,通过css + div模拟了一个 (parent)drop down list,其内部嵌套另一个(child)drop down list, 想将内部子下拉菜单取值后的内容传给外层的drop down list后输出,但不知如何修改代码,求大家帮忙指点一下。以下是代码:




demo.html
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
        <title>Custom Drop-Down List Styling</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
        <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css' />
        <script type="text/javascript" src="modernizr.custom.79639.js"></script> 
        <noscript><link rel="stylesheet" type="text/css" href="noJS.css" /></noscript>    
    </head>
    <body>
        <div class="container">
         
            <!-- Codrops top bar -->
            <div class="codrops-top"></div><!--/ Codrops top bar -->
             
            <header>
             
                <h1>&nbsp;</h1>
                <h2>&nbsp;</h2>
                 
                <nav class="codrops-demos"></nav>
                 
            </header>
             
            <section class="main">
                <div class="wrapper-demo">
                    <div id="dd" class="wrapper-dropdown-1" tabindex="1">
                        <span>Select Contact</span>
                        <ul class="dropdown" tabindex="1">
  相关解决方案