title: How to assign data-bind value to javascript variable
body: <p>New to asp.net</p>
  
  <pre><code>        &lt;div class="form-group"&gt;
              &lt;div class="col-sm-5"&gt;
                  &lt;p&gt;Showing results for FU &lt;span data-bind="text: selectedFu() ? selectedFu().fuId : ''" /&gt;&lt;/p&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          @{
              var sfuId = "Bar";
          }
  
          @if (sfuId == "Bar") {
              &lt;div class="form-group"&gt;
                  &lt;div class="col-sm-12"&gt;
                      &lt;div class="warn"&gt;
                          &lt;span data-bind="text: barDisclaimer"&gt;&lt;/span&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          }
  </code></pre>
  
  <p>Works but how do I assign var sfuId = selectedFu() ? selectedFu().fuId.I have tried var sfuId = ", data-bind="if:, and ko.observable() but can't seem to get anything to work.</p>
  
  <p>Thank You tkestowicz. knockoutjs.com is a great site. I will read through and post if I figure it out.</p>