hello want display text when user selects item of dropdownlist. on page default text displayed if user selects item dropdown list focus goes perticular text section. in code if select 'a' item on page focus goes 'a' item text. don't know how in javascript ,can please me.
<html> <head> <script type="text/javascript" language="javascript"> function changetext() { var parm = document.getelementbyid("myselection"); document.getelementbyid('lbltxt').innerhtml = parm.options[parm.selectedindex].text; } </script> </head> <body> <select id="myselection" onchange="return changetext();" style="width:30%;"> <option disabled="disabled" selected="selected">select method</option> <option value="1">a (new version)</option> <option value="2">b (old version)</option> <option value="3">c</option> </select> <b><label id="lblid" /></b><br /><br /> <strong id="1">a(for new versions)</strong><br /> in a, can done denying options verb http verb request filtering rules in iis.following example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html content<br /> <img src="images/1.png" style="float:left;"><img style="float:left;" src="images/arrow_up.png" width="62" height="60">following example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html content<br /> <br /> <strong id="2">b (for old versions)</strong><br /> b :<br /> following example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html content <img src="images/2.png">following example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html content<br /><br /> <strong id="3">c</strong><br /> <p style="text-align:justify; font-size:17px;">following example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html contentfollowing example makes use of .html() , .text(val) methods. here .html() retrieves html content</p> </body> </html>
first should call javascript function in onchange() event of dropdown can add label in position of text want. can set text page load (all items) label. , in javascript (called when drop down changed), can alter label text according drop down selection.
in page loading can assign values label, want all.
function changetext() { var contenttext; var selecteditem=''; var parm = document.getelementbyid("myselection"); selecteditem =parm.options[parm.selectedindex].text; if(selecteditem == 'a') contenttext = 'type want option a' else if(selecteditem == 'b') contenttext = 'type want option b' str='<tr> <td>' + contenttext +' </td> </tr>'; $("#test").append(str); }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <table id="test"> <tr> <td width="40%" align="left"> <select id="myselection" onchange="changetext();" style="width: 100%;"> <option disabled="disabled" selected="selected">select method</option> <option value="1">a</option> <option value="2">b</option> <option value="3">c</option> </select> </td> </tr> </table>
Comments
Post a Comment