javascript - Get div id from select value -
good day. please me. have code:
<form action="" method="post" id="dynamic_selects"> <table> <tr> <td> <select id="type" multiple> <option value="63">1963</option> <option value="64">1964</option> <option value="65">1965</option> <option value="66">1966</option> <option value="67">1967</option> <option value="68">1968</option> <option value="69">1969</option> <option value="70">1970</option> <option value="71">1971</option> <option value="72">1972</option> <option value="73">1973</option> <option value="74">1974</option> <option value="75">1975</option> <option value="76">1976</option> <option value="77">1977</option> <option value="78">1978</option> <option value="79">1979</option> <option value="80">1980</option> <option value="81">1981</option> <option value="82">1982</option> <option value="83">1983</option> <option value="84">1984</option> <option value="85">1985</option> <option value="86">1986</option> <option value="87">1987</option> <option value="89">1989</option> <option value="91">1991</option> </select> </td> <td> <select id="kind" disabled multiple> <option value="0"></option> </select> </td> <td> <select id="category" onchange="showhideblocks(this.value)" disabled multiple> <option value="0"></option> </select> </td> </tr> </table> </form>
i want change div id according value 'category':
<div id="it635" style="display:none;"> <a href="#" role="button" data-toggle="modal"><img src="./docs/button-blyat.jpg"></a> </div>
and href too, according value 'category' (values in file, won't post here)
thanks. p.s. 1 more question: how can forbid multiple select, leave selection boxes same in columns?
html:
<div id="it635" style="display:none;" class="somediv"> ...
js:
// bind change event on drop down! $('#type').change(function(){ $('.somediv').attr('id' , $('#type').val() ); });
and similar code a:
$('.somediv a').attr('href' , 'some-link#' + $('#type').val() );
Comments
Post a Comment