checkbox - How to connect dynamic checboxes with dropdown list in jQuery -
you click checkbox, same selected on select list/drop-down list , reverse. select on select list , checkbox checked, 1 in time selection.
<html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> </head> <body> <form> <h3>select color</h3> <div id="checkboxes"> <label for="red"> <input type="checkbox" id="red" value="0" onclick="selcolor(0);" >red</label> <label for="blue"> <input type="checkbox" id="blue" value="1" onclick="selcolor(1);" checked>blue</label> <label for="green"> <input type="checkbox" id="green" value="2" onclick="selcolor(2);" />green</label> </div> <div> <select name="selectcolorlist" id="selectlist" onchange="selectchanged()"> <option value="0">red</option> <option value="1" selected>blue</option> <option value="2">green</option> </select> </div> </form> <script> $(document).ready(function(){ $("#checkboxes"). }); </script> </body> </html>
any above ??
Comments
Post a Comment