javascript - How can I display student fee in another div upon the courses selected using JQuery? -


i building student registration system. want new applicant see fee have pay upon type of courses selected in html select input field. wrote similar code not working me. please help.

jquery code:

<script>    $(document).ready(function(e) {      if($("#coursestype").val()=="database technology"){          $("#fee").html(" ghs 1,1200");         }   });     </script> 

html code:

<label>ipmc courses :</label>   <select id="coursestype" name="coursestype">     <option value="software engineering">software engineering</option>     <option value="database technology">database tech</option>     <option value="graphic web design" selected="selected">graphic web design</option>     <option value="computing">computing</option>     <option value="business i.t">business i.t</option>     <option value="business">business</option>     <option value="tally certified">tally certified</option>     <option value="authocad 2010">authocad 2010</option>     <option value="foundation">foundation</option>     <option value="certified ethical hacking">certified ethical hacking</option>   </select>    fee:<div id="fee"></div> 

please help.

you need wait select change. code work:

$(document).ready(function(e) {     $("#coursestype").change(function(){         if($("#coursestype").val()=="database technology"){             $("#fee").html(" ghs 1,1200");         } else {             $("#fee").html("all money");         }     }); }); 

jsfiddle


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -