Change form input value with Jquery

后端 未结 2 1594
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 03:21

I am trying to change the input field value dynamically when the user pick the options from my dropdown menu. I have tried this code but have no luck. I was wondering if som

2条回答
  •  时光取名叫无心
    2020-12-29 04:04

    The code below should work. I modified the in the html to be formatted correctly as well as changed $('input[name="project"]').val()="Good Fish"; to $('input[name="project"]').val("Good Fish");

    $(document).ready(function(){
        $('select[name="job_number"]').change(function() {
    
            $('input[name="project"]').val("Good Fish");
    
        });
    });
    
    

提交回复
热议问题