0

以下の入力フィールドを次のようにレンダリングするにはどうすればよいですか

<input name= "NIALL" type="text" /> 

以下のノックアウト モデルと html を使用します。ノックアウト モデルに基づいて要素の名前を作成したいことに注意してください。Heres ive を試してみましたが、うまくいきません。

HTML

 <input type="text" data-bind="value: stringValue,attr: { 'name': ElementName}" />  

//ノックアウトモデル

function MyViewModel() {

  var self = this;
  self.stringValue = "sss";
  self.ElementName = "NIALL";
}
4

1 に答える 1

0

The code is fine, it will work in IE's developer tools if you hit Refresh on the dev tools toolbar. Or look at it with firebuglite's bookmarklet from inside IE.

于 2012-07-20T02:58:23.157 に答える