how to set textbox value in jquery

后端 未结 4 1889
庸人自扰
庸人自扰 2020-12-01 06:15

How do I properly load the a certain value into a textbox using jquery?Tried the one below but I get the [object Object] as output. Please enlighten me on this,

4条回答
  •  無奈伤痛
    2020-12-01 06:43

    try

    subtotal.value= 5 // some value
    

    proc = async function(x,y) {
      let url = "https://server.test-cors.org/server?id=346169&enable=true&status=200&credentials=false&methods=GET&" // some url working in snippet
      
      let r= await(await fetch(url+'&prodid=' + x + '&qbuys=' + y)).json(); // return json-object
      console.log(r);
      
      subtotal.value= r.length; // example value from json
    }
    
    
    
    Product id:
    Quantity to buy:
    Subtotal:

提交回复
热议问题