updating “placeholder” attribute using knockout

后端 未结 2 1723
太阳男子
太阳男子 2020-12-29 05:19

I have a form with some fields getting some data using knockout.js (ver. 2.1.0). For example, to update the \"value\" field of an input I put:



        
2条回答
  •  無奈伤痛
    2020-12-29 05:47

    You should use the existing attr binding, like this:

    
    
    var Model = function () {
        this.ph = ko.observable("Text..."); 
    }
    ko.applyBindings(new Model());
    

提交回复
热议问题